platform/upstream/ninja.git
13 years agoMerge pull request #132 from nico/spell
Evan Martin [Wed, 16 Nov 2011 21:21:46 +0000 (13:21 -0800)]
Merge pull request #132 from nico/spell

Add spelling suggestions for four cases:

13 years agoAdd spelling suggestions for four cases:
Nico Weber [Wed, 16 Nov 2011 05:38:21 +0000 (21:38 -0800)]
Add spelling suggestions for four cases:

1. For targets, when invoking ninja to build a target.
2. For targets, when doing a "query" command.
3. For command names.
4. For the subcommands of the "targets" command.

Also change CmdTargets() to call LookupNode() instead of GetNode() --
since the result was checked for NULL, that's probably what was intended
here originally.

13 years agofix TODO: correct dependencies for inline.sh
Evan Martin [Sun, 13 Nov 2011 20:48:32 +0000 (12:48 -0800)]
fix TODO: correct dependencies for inline.sh

Not sure why I just didn't write this right the first time; when running
a script for its output, the script is always an implicit input of the
output.

13 years agoAdd a EditDistance() function based on the one in llvm/lib/Support/StringRef.cpp.
Nico Weber [Thu, 10 Nov 2011 20:58:00 +0000 (12:58 -0800)]
Add a EditDistance() function based on the one in llvm/lib/Support/StringRef.cpp.

13 years agoMerge pull request #131 from secondplanet/patch-1
Evan Martin [Sun, 13 Nov 2011 20:16:09 +0000 (12:16 -0800)]
Merge pull request #131 from secondplanet/patch-1

Improvements to ninja-mode

13 years agoImprovements to ninja-mode
Humza [Sun, 13 Nov 2011 16:30:10 +0000 (11:30 -0500)]
Improvements to ninja-mode

* provide ninja-mode feature
* highlight rule names

13 years agoMerge pull request #127 from tiresdonexits/master
Evan Martin [Sun, 6 Nov 2011 00:02:06 +0000 (17:02 -0700)]
Merge pull request #127 from tiresdonexits/master

Minor code change to address a warning in g++ 4.6.

13 years agoAdded a cast to NULL to remove a warning issues by g++ 4.6.
Jonathan Sternberg [Sat, 5 Nov 2011 19:58:51 +0000 (15:58 -0400)]
Added a cast to NULL to remove a warning issues by g++ 4.6.

13 years agoMerge pull request #123 from pcc/commands-tool
Evan Martin [Fri, 4 Nov 2011 23:31:35 +0000 (16:31 -0700)]
Merge pull request #123 from pcc/commands-tool

Add a "commands" tool

13 years agoAdd a "commands" tool
Peter Collingbourne [Mon, 3 Oct 2011 03:02:11 +0000 (04:02 +0100)]
Add a "commands" tool

This tool performs a post-order traversal of the build graph, starting
from a list of targets specified on the command line, and for each
build statement encountered, prints the evaluated command line.
Use cases include:

- Generating input for a tool which needs to know the full command line
  for every command invoked during a build.  Many static analysis
  and indexing tools require this information.

- Generating a build script which does not depend on Ninja.
  For example, such a script could be used by Ninja to bootstrap
  itself.

13 years agoMerge pull request #125 from pcc/outputs-ready
Evan Martin [Wed, 2 Nov 2011 06:26:33 +0000 (23:26 -0700)]
Merge pull request #125 from pcc/outputs-ready

CMake requirements: Make-style order-only dependencies, restat rules

13 years agodon't leak fds into subprocesses
Evan Martin [Mon, 31 Oct 2011 22:39:03 +0000 (15:39 -0700)]
don't leak fds into subprocesses

Patch from Antoine Labour <piman@chromium.org>, (hacky) test by me.

13 years agomove SetCloseOnExec to util
Evan Martin [Mon, 31 Oct 2011 22:30:29 +0000 (15:30 -0700)]
move SetCloseOnExec to util

13 years agoImplement restat rules
Peter Collingbourne [Mon, 19 Sep 2011 01:56:15 +0000 (02:56 +0100)]
Implement restat rules

A restat rule is a rule which is capable of pruning the build tree
depending on the timestamps of its outputs before and after a build.
After a restat rule is rebuilt, Ninja will re-stat each output file
to obtain its current timestamp.  If the timestamp is unchanged from
when Ninja initially stat'ed the file before starting the build,
Ninja will mark that output file as clean, and recursively for each
reverse dependency of the output file, recompute its dirty status.

Ninja then stores the most recent timestamp of any input file in the
build log entry associated with the output file.  This timestamp
will be treated by future invocations of Ninja as the output file's
modification time instead of the output file's actual modification
time for the purpose of deciding whether it is dirty (but not whether
its reverse dependencies are dirty).

13 years agoCreate log entries in BuildLog::RecordCommand without requiring a log file
Peter Collingbourne [Sun, 2 Oct 2011 00:57:41 +0000 (01:57 +0100)]
Create log entries in BuildLog::RecordCommand without requiring a log file

This permits us to write tests that write and later read from
the build log without needing a temporary log file.

13 years agoImplement Make-style order-only dependencies
Peter Collingbourne [Sun, 18 Sep 2011 02:28:44 +0000 (03:28 +0100)]
Implement Make-style order-only dependencies

Previously, the implementation of order-only dependencies differed
between Make and Ninja in two important ways:

 1) If the order-only dependency existed but was out of date, it
    would never be rebuilt, whereas Make would always rebuild out of
    date order-only dependencies.

 2) If the order-only dependency did not exist, it would cause
    its reverse dependencies to always build, whereas Make would only
    rebuild a file if a non-order-only dependency was out of date.

A key distinction between Ninja and Make as seen through the above
two points was that in Ninja, order-only dependencies cared about
whether the target as a file exists (so perhaps a better name for
the old semantics would have been "missing-only dependencies").

These differences made it impossible to introduce an order-only
dependency on an always out-of-date (i.e. missing) target without
also causing the depender and its reverse dependencies to rebuild
unnecessarily on every build.  Build systems which must perform some
action (such as logging the build start time, or printing a message)
at the start of every build typically implement this by adding to
every target an order-only dependency which performs this action,
which would have forced an entire rebuild on every invocation of
Ninja under the old semantics.

This commit causes Ninja to conform to the Make-style behaviour.

13 years agoSplit Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_
Peter Collingbourne [Sun, 18 Sep 2011 02:07:35 +0000 (03:07 +0100)]
Split Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_

dirty_ is intended to remain static during the build (unless a restat
occurs), while outputs_ready_ reflects the dynamic state of the build.

13 years agoMerge pull request #120 from pcc/generator
Evan Martin [Mon, 17 Oct 2011 22:16:49 +0000 (15:16 -0700)]
Merge pull request #120 from pcc/generator

Implement generator rules

13 years agoMake the command line interface for the clean tool consistent
Peter Collingbourne [Sat, 15 Oct 2011 18:55:33 +0000 (19:55 +0100)]
Make the command line interface for the clean tool consistent

Since we have started using command line flags for the clean tool, it
is inconsistent to keep the "target" and "rule" prefixes.  Replace them
with a "-r" flag with the same semantics as "rule".

13 years agoImplement generator rules
Peter Collingbourne [Thu, 22 Sep 2011 16:04:03 +0000 (17:04 +0100)]
Implement generator rules

Introduce a rule attribute "generator" which, if present, specifies
that this rule is used to re-invoke the generator program.  Files built
using generator rules are treated specially in two ways: firstly,
they will not be rebuilt if the command line changes; and secondly,
they are not cleaned by default.

A command line flag "-g" is introduced for the clean tool, which
causes it to remove generator files.

Fixes issue #102.

13 years agopass extra flags into the tool
Evan Martin [Fri, 14 Oct 2011 01:00:47 +0000 (18:00 -0700)]
pass extra flags into the tool

13 years agoElide output in the middle when exceeding terminal width.
Nicolas Despres [Wed, 12 Oct 2011 16:33:08 +0000 (18:33 +0200)]
Elide output in the middle when exceeding terminal width.

When building projects with long file paths, the rule name may
disappear since the output is elided on the left side.
So you no longer know whether you are compiling or linking.

I think the user is interested in both the rule name and the file name.

Eliding the output in the middle solves this problem.

13 years agomake CanonicalizePath report an error on empty path
Evan Martin [Thu, 6 Oct 2011 00:51:06 +0000 (17:51 -0700)]
make CanonicalizePath report an error on empty path

Fixes part of issue 121, but the fix exposed a further issue.

13 years agoMerge pull request #119 from pcc/disable-asserts
Evan Martin [Wed, 28 Sep 2011 06:43:30 +0000 (23:43 -0700)]
Merge pull request #119 from pcc/disable-asserts

Disable assertion checks unless --debug is enabled

13 years agoDisable assertion checks unless --debug is enabled
Peter Collingbourne [Wed, 21 Sep 2011 13:09:42 +0000 (14:09 +0100)]
Disable assertion checks unless --debug is enabled

13 years agoadd syntax to build output from a given file
Evan Martin [Thu, 22 Sep 2011 21:03:07 +0000 (14:03 -0700)]
add syntax to build output from a given file

e.g. "ninja src/graph.cc^" builds the object file generated from that input

13 years agocommand line supports multiple targets
Evan Martin [Thu, 22 Sep 2011 17:42:43 +0000 (10:42 -0700)]
command line supports multiple targets

13 years agomake options const
Evan Martin [Thu, 22 Sep 2011 17:38:56 +0000 (10:38 -0700)]
make options const

13 years agostylistic cleanups
Evan Martin [Thu, 22 Sep 2011 17:37:19 +0000 (10:37 -0700)]
stylistic cleanups

13 years agonote that target is optional in command-line help
Evan Martin [Thu, 22 Sep 2011 17:07:29 +0000 (10:07 -0700)]
note that target is optional in command-line help

13 years agodelete todo; I converted it into bugs on github
Evan Martin [Thu, 15 Sep 2011 23:54:59 +0000 (16:54 -0700)]
delete todo; I converted it into bugs on github

13 years agodelete .a files before adding to them with ar
Evan Martin [Wed, 14 Sep 2011 19:08:02 +0000 (12:08 -0700)]
delete .a files before adding to them with ar

ar doesn't have a mode to just rebuild the file from scratch, so delete
it manually.

Fixes issue #105.

13 years agoMerge pull request #106 from pcc/depfile-vector
Evan Martin [Wed, 14 Sep 2011 15:57:36 +0000 (08:57 -0700)]
Merge pull request #106 from pcc/depfile-vector

Allocate space in the inputs vector for the depfile implicit deps

13 years agoMerge pull request #107 from pcc/missing-phony
Evan Martin [Wed, 14 Sep 2011 15:55:46 +0000 (08:55 -0700)]
Merge pull request #107 from pcc/missing-phony

Consider missing phony targets with no dependencies out of date

13 years agoConsider missing phony targets with no dependencies out of date
Peter Collingbourne [Wed, 14 Sep 2011 00:32:15 +0000 (01:32 +0100)]
Consider missing phony targets with no dependencies out of date

Commit 639c8f0 ("don't mark phony edges dirty if none of their
inputs are dirty") modified the behaviour of the "phony" built-in
rule.  Previously, when the output file was missing, it was marked
as dirty.  After 639c8f0, it was always marked as clean unless one
of the dependencies was dirty.  The depfile mechanism uses the old
behaviour of "phony" to rebuild an object file if any of the headers
were missing.

Restore the old "phony" behaviour only for the case where the build
statement has no dependencies.  This is slightly inconsistent, but I
can't really see any other use case for an alias of nothing.  Also,
document this behaviour.

13 years agoModify the build tests to use the virtual file system
Peter Collingbourne [Sun, 11 Sep 2011 21:54:00 +0000 (22:54 +0100)]
Modify the build tests to use the virtual file system

13 years agoAllocate space in the inputs vector for the depfile implicit deps
Peter Collingbourne [Wed, 14 Sep 2011 00:32:09 +0000 (01:32 +0100)]
Allocate space in the inputs vector for the depfile implicit deps

This speeds up a no-op LLVM/Clang build by about 20ms.

13 years agogeneralize the pattern of hash_map<const char*, ...>, use in BuildLog
Evan Martin [Mon, 12 Sep 2011 18:44:12 +0000 (11:44 -0700)]
generalize the pattern of hash_map<const char*, ...>, use in BuildLog

Refactor the code in StatCache for use in BuildLog.  Now both use
hash tables where the keys are const char*.  Removes another 30ms
from Chrome no-op builds.

13 years agouse StringPiece for makefile deps
Evan Martin [Mon, 12 Sep 2011 17:17:11 +0000 (10:17 -0700)]
use StringPiece for makefile deps

Because of this, MakefileParser now returns pointers into the source
makefile string rather than allocating new strings.  Despite needing
to take the result and stuff it into a new string anyway to canonicalize
it, this takes another 50ms or so off the null Chrome build, likely
due to the vector used in MakefileParser changing to a type that doesn't
use any allocations.

(I also experimented with making the vector reserve an initial size but
didn't see any performance impact.)

13 years agoMerge pull request #104 from tfarina/ninja-test
Evan Martin [Mon, 12 Sep 2011 02:45:53 +0000 (19:45 -0700)]
Merge pull request #104 from tfarina/ninja-test

Split ninja_test.cc into state_test.cc and disk_interface_test.cc

13 years agoSplit ninja_test.cc into state_test.cc and disk_interface_test.cc
Thiago Farina [Sun, 11 Sep 2011 22:29:38 +0000 (19:29 -0300)]
Split ninja_test.cc into state_test.cc and disk_interface_test.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #103 from tfarina/struct
Evan Martin [Sun, 11 Sep 2011 04:32:06 +0000 (21:32 -0700)]
Merge pull request #103 from tfarina/struct

This is C++, there is no need to write 'struct' before the type when decl

13 years agoThis is C++, there is no need to write 'struct' before the type when declaring a...
Thiago Farina [Sat, 10 Sep 2011 20:37:01 +0000 (17:37 -0300)]
This is C++, there is no need to write 'struct' before the type when declaring a variable.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agochange main hash to char*; use pointers into files
Evan Martin [Sat, 10 Sep 2011 00:18:28 +0000 (17:18 -0700)]
change main hash to char*; use pointers into files

This has a small (20ms) effect on Chrome, but it will also be used
more as I remove more strings.

13 years agooptimize IsIdentChar
Evan Martin [Fri, 9 Sep 2011 22:52:36 +0000 (15:52 -0700)]
optimize IsIdentChar

Rather than nested tests, use a table.  Shaves 200ms off Chrome null startup.

13 years agofix "ignored return value of write" harder
Evan Martin [Fri, 9 Sep 2011 22:06:02 +0000 (15:06 -0700)]
fix "ignored return value of write" harder

13 years agoverify -k param is numeric
Evan Martin [Fri, 9 Sep 2011 21:09:25 +0000 (14:09 -0700)]
verify -k param is numeric

Fixes issue #85.

13 years agominor cleanups
Evan Martin [Fri, 9 Sep 2011 21:03:59 +0000 (14:03 -0700)]
minor cleanups

13 years agodon't mark phony edges dirty if none of their inputs are dirty
Evan Martin [Fri, 9 Sep 2011 20:48:27 +0000 (13:48 -0700)]
don't mark phony edges dirty if none of their inputs are dirty

Because the output file is always missing, we'd consider a phony edge
dirty even when there wasn't any work to do.  Most importantly, that
would mean we wouldn't print "nothing to do" in the common case of
everything being up to date when building an alias.

13 years agoMerge pull request #101 from tfarina/build-config-reference
Evan Martin [Fri, 9 Sep 2011 18:38:37 +0000 (11:38 -0700)]
Merge pull request #101 from tfarina/build-config-reference

Make Cleaner::config_ a reference-to-const instead of copying the value.

13 years agoMerge pull request #95 from qhuo/depfile-for-command-with-multiple-outputs
Evan Martin [Fri, 9 Sep 2011 18:37:23 +0000 (11:37 -0700)]
Merge pull request #95 from qhuo/depfile-for-command-with-multiple-outputs

Add depfile support to build command with multiple outputs (Fixes: #61)

13 years agoMake Cleaner::config_ a reference-to-const instead of copying the value.
Thiago Farina [Fri, 9 Sep 2011 17:26:59 +0000 (14:26 -0300)]
Make Cleaner::config_ a reference-to-const instead of copying the value.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agolink gtest code with -lpthread
Evan Martin [Fri, 9 Sep 2011 15:53:08 +0000 (08:53 -0700)]
link gtest code with -lpthread

I broke this in a refactoring.

13 years agoMerge pull request #99 from tfarina/eval-env-test
Evan Martin [Fri, 9 Sep 2011 14:43:55 +0000 (07:43 -0700)]
Merge pull request #99 from tfarina/eval-env-test

Move EvalString tests to eval_env_test.cc

13 years agoMove EvalString tests to eval_env_test.cc
Thiago Farina [Fri, 9 Sep 2011 02:51:53 +0000 (23:51 -0300)]
Move EvalString tests to eval_env_test.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #98 from tfarina/fix-win-build
Evan Martin [Thu, 8 Sep 2011 02:51:29 +0000 (19:51 -0700)]
Merge pull request #98 from tfarina/fix-win-build

Fix windows build by moving mkdtemp() implementation from ninja_test.cc t

13 years agoMerge branch 'master' of github.com:martine/ninja
Evan Martin [Thu, 8 Sep 2011 01:48:41 +0000 (18:48 -0700)]
Merge branch 'master' of github.com:martine/ninja

Conflicts:
configure.py

13 years agofix redundant manifest rebuild
Evan Martin [Thu, 8 Sep 2011 01:33:10 +0000 (18:33 -0700)]
fix redundant manifest rebuild

Don't rebuild the manifest when it's already up to date.
The underlying problem was that Builder::Build has a confusing API;
split the API so it's more clear for callers what the return values
mean.

13 years agoFix windows build by moving mkdtemp() implementation from ninja_test.cc to disk_inter...
Thiago Farina [Thu, 8 Sep 2011 00:23:33 +0000 (21:23 -0300)]
Fix windows build by moving mkdtemp() implementation from ninja_test.cc to disk_interface_test.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoallow --with-gtest flag to use unpacked gtest dir
Evan Martin [Wed, 7 Sep 2011 23:47:57 +0000 (16:47 -0700)]
allow --with-gtest flag to use unpacked gtest dir

Useful for building on Macs.

13 years agoMerge pull request #96 from tfarina/disk-interface-test
Evan Martin [Wed, 7 Sep 2011 23:10:50 +0000 (16:10 -0700)]
Merge pull request #96 from tfarina/disk-interface-test

Move DiskInterfaceTest into its own source file.

13 years agoMove DiskInterfaceTest into its own source file.
Thiago Farina [Wed, 7 Sep 2011 17:40:41 +0000 (14:40 -0300)]
Move DiskInterfaceTest into its own source file.

TEST=ninja_test --gtest_filter=DiskInterface*

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMove a passing test from Errors to MultipleOutputs
Qingning Huo [Tue, 6 Sep 2011 21:19:45 +0000 (22:19 +0100)]
Move a passing test from Errors to MultipleOutputs

13 years agopreserve configure.py params across re-runs
Evan Martin [Tue, 6 Sep 2011 21:04:31 +0000 (14:04 -0700)]
preserve configure.py params across re-runs

13 years agoMerge pull request #91 from pcc/reload-manifest
Evan Martin [Tue, 6 Sep 2011 21:01:17 +0000 (14:01 -0700)]
Merge pull request #91 from pcc/reload-manifest

Support for rebuilding and reloading manifest files

13 years agobuild only the main binary by default
Evan Martin [Tue, 6 Sep 2011 20:00:38 +0000 (13:00 -0700)]
build only the main binary by default

13 years agoadd 'default' keyword to python module
Evan Martin [Tue, 6 Sep 2011 19:59:47 +0000 (12:59 -0700)]
add 'default' keyword to python module

13 years agodon't use "all" in the phony example, because we now have "default"
Evan Martin [Tue, 6 Sep 2011 19:52:22 +0000 (12:52 -0700)]
don't use "all" in the phony example, because we now have "default"

13 years agolink to github in docs
Evan Martin [Tue, 6 Sep 2011 19:51:33 +0000 (12:51 -0700)]
link to github in docs

13 years agoAdd depfile support to build command with multiple outputs (Fixes: #61)
Qingning Huo [Tue, 6 Sep 2011 19:46:32 +0000 (20:46 +0100)]
Add depfile support to build command with multiple outputs (Fixes: #61)

parsers.cpp: allow depfile used at build command with multiple outputs.
graph.cpp: allow depfile used at build command with multiple outputs.
parsers_test.cpp: make the test pass.

As before, the depfile itself can only mention one target, which must
be the first of a build command with multiple outpus.

[There is really no need to mention all the output in the depfile,
because all targets should depend on exactly the same files anyway,
because these targets are built by a single build command.]

13 years agoupdate docs on other build system integration with recent news
Evan Martin [Tue, 6 Sep 2011 19:11:08 +0000 (12:11 -0700)]
update docs on other build system integration with recent news

13 years agomake --profile take an argument to use either gmon or google-pprof
Evan Martin [Tue, 6 Sep 2011 18:51:50 +0000 (11:51 -0700)]
make --profile take an argument to use either gmon or google-pprof

13 years agoMerge pull request #94 from qhuo/named-pipe
Evan Martin [Sun, 4 Sep 2011 15:05:48 +0000 (08:05 -0700)]
Merge pull request #94 from qhuo/named-pipe

subprocess-win32.cc: change named pipe names to contain process ID and subprocess object address.

13 years agosubprocess-win32.cc: change named pipe names to contain process ID and subprocess...
Qingning Huo [Sun, 4 Sep 2011 10:29:02 +0000 (11:29 +0100)]
subprocess-win32.cc: change named pipe names to contain process ID and subprocess object address.

13 years agoSupport for rebuilding and reloading manifest files
Peter Collingbourne [Sat, 27 Aug 2011 01:25:57 +0000 (02:25 +0100)]
Support for rebuilding and reloading manifest files

This introduces support for rebuilding the top-level manifest file
using a provided build statement, and reloading it before building
the user-requested targets.

13 years agoMerge pull request #89 from tfarina/state
Evan Martin [Sat, 3 Sep 2011 20:38:44 +0000 (13:38 -0700)]
Merge pull request #89 from tfarina/state

Factor out State struct from ninja_jumble.cc into its header/source files

13 years agoFactor out State struct from ninja_jumble.cc into its header/source files.
Thiago Farina [Fri, 26 Aug 2011 23:58:28 +0000 (20:58 -0300)]
Factor out State struct from ninja_jumble.cc into its header/source files.

This was a TODO in src/ninja_jumble.cc. Now this task is completed.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #92 from pcc/fix-warning
Evan Martin [Sat, 3 Sep 2011 15:52:18 +0000 (08:52 -0700)]
Merge pull request #92 from pcc/fix-warning

Fix a Clang self-assign warning by casting result to void

13 years agoMerge pull request #90 from pcc/default-target-statements
Evan Martin [Sat, 3 Sep 2011 15:37:03 +0000 (08:37 -0700)]
Merge pull request #90 from pcc/default-target-statements

Implement default target statements

13 years agoFix a Clang self-assign warning by casting result to void
Peter Collingbourne [Wed, 31 Aug 2011 17:55:38 +0000 (18:55 +0100)]
Fix a Clang self-assign warning by casting result to void

13 years agoImplement default target statements
Peter Collingbourne [Wed, 31 Aug 2011 03:55:35 +0000 (04:55 +0100)]
Implement default target statements

This introduces a new directive, the default target statement, which
may be used to control the list of targets built by default (i.e. if
no target is named on the command line).

13 years agoninja_syntax.py: add include and subninja
Evan Martin [Mon, 29 Aug 2011 18:19:22 +0000 (11:19 -0700)]
ninja_syntax.py: add include and subninja

13 years agoMerge pull request #87 from tfarina/fix-ninja-compilation
Evan Martin [Fri, 26 Aug 2011 20:40:45 +0000 (13:40 -0700)]
Merge pull request #87 from tfarina/fix-ninja-compilation

Fix ninja compilation by including a missing disk_interface.h.

13 years agoFix ninja compilation by including a missing disk_interface.h.
Thiago Farina [Thu, 25 Aug 2011 20:00:38 +0000 (17:00 -0300)]
Fix ninja compilation by including a missing disk_interface.h.

When running ./ninja the compilation fails because test.h uses DiskInterface but
doesn't include disk_interface.h to get the declaration.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #86 from tfarina/real-disk-interface
Evan Martin [Thu, 25 Aug 2011 15:02:51 +0000 (08:02 -0700)]
Merge pull request #86 from tfarina/real-disk-interface

Move RealDiskInterface class to disk_interface.h.

13 years agoMove RealDiskInterface class to disk_interface.h.
Thiago Farina [Wed, 24 Aug 2011 00:33:41 +0000 (21:33 -0300)]
Move RealDiskInterface class to disk_interface.h.

This is a TODO in src/ninja_jumble.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agosemantic change: allow reaching into parent directories in paths
Evan Martin [Wed, 24 Aug 2011 22:49:41 +0000 (15:49 -0700)]
semantic change: allow reaching into parent directories in paths

This allows generating build files in a subdirectory of your source tree.
- Change CanonicalizePath to accept this.
- CanonicalizePath no longer has an error condition, so change it to a void
  function.

I profiled the result against Chrome and it might be ~100ms slower, but that
might just be Chrome's size working against me.  In any case I think there
are lower-hanging performance fruit elsewhere.

13 years agoMerge pull request #82 from tfarina/disk-interface
Evan Martin [Tue, 23 Aug 2011 16:17:23 +0000 (09:17 -0700)]
Merge pull request #82 from tfarina/disk-interface

Factor out DiskInterface class into its own source/header files.

13 years agoMerge pull request #83 from rlarocque2/master
Evan Martin [Thu, 18 Aug 2011 17:38:45 +0000 (10:38 -0700)]
Merge pull request #83 from rlarocque2/master

Update configure.py following ninja.py rename

13 years agoUpdate configure.py for ninja module rename
Richard Larocque [Wed, 17 Aug 2011 18:32:39 +0000 (11:32 -0700)]
Update configure.py for ninja module rename

13 years agorename ninja module to ninja_syntax
Evan Martin [Tue, 9 Aug 2011 20:38:43 +0000 (13:38 -0700)]
rename ninja module to ninja_syntax

13 years agoadd escaping function to python module
Evan Martin [Tue, 9 Aug 2011 20:21:21 +0000 (13:21 -0700)]
add escaping function to python module

13 years agoFactor out DiskInterface class into its own source/header files.
Thiago Farina [Wed, 10 Aug 2011 12:47:32 +0000 (09:47 -0300)]
Factor out DiskInterface class into its own source/header files.

This is a TODO in src/ninja_jumble.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #80 from tfarina/master
Evan Martin [Wed, 10 Aug 2011 03:31:45 +0000 (20:31 -0700)]
Merge pull request #80 from tfarina/master

fix trivial style issue.

13 years agoFix trivial style issues with Cleaner class.
Thiago Farina [Tue, 9 Aug 2011 23:07:50 +0000 (20:07 -0300)]
Fix trivial style issues with Cleaner class.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agofix double-indenting
Evan Martin [Wed, 27 Jul 2011 17:06:52 +0000 (10:06 -0700)]
fix double-indenting

13 years agoninja.py: fix the new test and pass the test
Evan Martin [Wed, 27 Jul 2011 16:59:22 +0000 (09:59 -0700)]
ninja.py: fix the new test and pass the test

From a patch from Elazar Leibovich <elazarl@gmail.com>.

13 years agounit test for line-wrapping in ninja.py
Evan Martin [Wed, 27 Jul 2011 16:35:50 +0000 (09:35 -0700)]
unit test for line-wrapping in ninja.py

From a patch from Elazar Leibovich <elazarl@gmail.com>.

13 years agodon't track line/column until you encounter an error, then re-parse
Evan Martin [Tue, 26 Jul 2011 00:51:47 +0000 (17:51 -0700)]
don't track line/column until you encounter an error, then re-parse

This speeds up the common case (where you don't need a line number)
at the small expense of the uncommon case (for error messages, you
do need a line number).  And it's less code.

13 years agoadd a --debug option to configure
Evan Martin [Mon, 25 Jul 2011 18:22:33 +0000 (11:22 -0700)]
add a --debug option to configure