680 Commits

Author SHA1 Message Date
Evan Martin
fd40d87dc0 remove reference to nonexistent file 2011-12-05 13:30:38 -08:00
Evan Martin
78d717c2d6 add help output to clean tool 2011-12-05 13:25:56 -08:00
Evan Martin
d7229a6927 prettify manual for tools 2011-12-05 13:22:09 -08:00
Evan Martin
560221d0fc also spell-check the 'clean' tool; abort on misspelling 2011-12-05 13:20:49 -08:00
Evan Martin
a988cb23ae minor manual touchups 2011-12-05 12:59:41 -08:00
Evan Martin
47596e8282 split out tool list into a separate subcommand
Fits the -h output on one screen again, and allows more whitespace
in both the -h output and the tool list.
2011-12-05 12:59:41 -08:00
Evan Martin
3d17415c46 disable the 'unused parameter' warning
It was firing too often, and hadn't uncovered any bugs.
2011-12-05 12:59:38 -08:00
Evan Martin
3b9f727e2b Merge pull request #150 from luislavena/mingw-no-visibility
visibility=hidden should not be used for Windows
2011-12-05 10:24:07 -08:00
Evan Martin
e0fb9775ac Merge pull request #149 from luislavena/mingw-static
Use g++'s -static option instead of specific libs
2011-12-05 10:22:12 -08:00
Luis Lavena
47b354129a visibility=hidden should not be used for Windows
While GCC 4.x supports the usage of -fvisibility=hidden and the related
pragmas, usage of it under MinGW is a noop and should not be used.

Instead, __declspec(dllexport/dllimport) should be used instead to
indicate exportable functions.

Since Ninja builds a static library, no functions are exported and
visibility, at least under MinGW, is not an issue.
2011-12-05 12:08:47 -03:00
Luis Lavena
7e3e51f607 Use g++'s -static option instead of specific libs
MinGW g++ recognizes -static as option to avoid the need to specify
individual libraries to be statically linked into the executable.

It also solves the warning of -static-libstdc++ not being recorgnized by
GCC 4.5.2 (TDM build)
2011-12-05 11:55:05 -03:00
Evan Martin
94b4844779 fix some minor style issues in RecomputeDirty 2011-12-04 13:11:05 -08:00
Evan Martin
f39ebbfa26 when an edge is dirty, mark all outputs dirty
The logic before was like:
  for each output:
    if edge_dirty or output.dirty:
      output.dirty = true
      edge_dirty = true

This was wrong in the case where the second output would case the edge
to be dirty; we needed to go back and mark the first output dirty as
well.  Fixed by taking two passes: one to compute the dirty state,
then a latter sweep to mark all outputs.

Fixes issue 148.
2011-12-04 13:07:11 -08:00
Evan Martin
d412c2cfec refactor RecomputeOutputDirty to return true/false for dirty
Rather than taking whether the edge is dirty as an input, instead
only consider the arguments and return true/false, allowing the caller
to decide what to do with that information.  (In the restat case we
were faking out the environment to get particular behavior for this.)

Should have no side effects, but this is part of fixing issue 148.
2011-12-04 12:16:47 -08:00
Evan Martin
a756c37431 add a test case from issue 148 2011-12-04 12:16:47 -08:00
Evan Martin
0742527a92 windows: don't buffer stdout 2011-12-01 21:53:00 -08:00
Evan Martin
ed53e89795 HACKING: windows notes 2011-12-01 21:36:19 -08:00
Evan Martin
70623a8dce bootstrap.sh: windows (mingw) fixes
- Don't build browse.cc in bootstrap.sh.
- Explicitly call out to Python to run configure.py.
- Run ninja-bootstrap with no arguments to build the default target,
which is "ninja.exe" on Windows.
2011-12-01 21:35:55 -08:00
Evan Martin
757c74f959 configure.py: windows updates
- Drop unused 'windows' platform
- Make 'mingw' platform actually work on mingw-on-Windows.
2011-12-01 21:35:55 -08:00
Evan Martin
25d9b1d92a windows: clear process launch structs before using them 2011-12-01 20:39:39 -08:00
Evan Martin
f20e002eea Revert "Merge pull request #143 from cipriancraciun/patches/python2"
This reverts commit 38ab41f45ff818b437942b753328a0168914fc86, reversing
changes made to 819d6347b424f583d651b86dd1280605ddb23b88.

Platforms that don't have /usr/bin/python pointing to python2 are broken.
2011-11-24 23:30:19 -08:00
Evan Martin
38ab41f45f Merge pull request #143 from cipriancraciun/patches/python2
Rename all occurences of `python` to `python2`
2011-11-21 17:21:31 -08:00
Evan Martin
819d6347b4 Merge pull request #142 from cipriancraciun/patches/custom-cflags-ldflags
Added support for custom CFLAGS and LDFLAGS.
2011-11-21 17:15:47 -08:00
Ciprian Dorin, Craciun
209d85b9fa Renamed python to python2. 2011-11-22 02:57:53 +02:00
Ciprian Dorin, Craciun
f3d13afdb1 Fixed Python 2 scripts prologue (i.e. #!/usr/bin/env python2). 2011-11-22 02:57:53 +02:00
Ciprian Dorin, Craciun
e1636b1ebe Added support for custom CFLAGS and LDFLAGS. 2011-11-22 02:51:47 +02:00
Evan Martin
2198fd8ce4 Merge pull request #138 from polrop/fix-warning-in-test
Fix compilation warning in Ninja's test suite.
2011-11-21 10:16:08 -08:00
Nicolas Despres
eb8a584edf Fix compilation warning in Ninja's test suite. 2011-11-21 12:52:49 +01:00
Evan Martin
73023f63f1 Merge pull request #136 from polrop/add-extra-warning
Add -Wextra compilation flags
2011-11-19 16:19:10 -08:00
Nicolas Despres
ccdef45a2a Remove warning triggered by -Wextra on MinGW. 2011-11-19 20:22:42 +01:00
Nicolas Despres
73b24b00cc Add -Wextra warning flag.
Fix triggered warnings:
- unused parameter
- type qualifiers ignored on function return type
- missing initializer for member
2011-11-19 19:35:32 +01:00
Evan Martin
68c5917bf9 Merge pull request #135 from polrop/fix-mingw
Fix mingw.
2011-11-19 10:24:17 -08:00
Evan Martin
a0536e289b Merge pull request #133 from polrop/fix-duplication
Fix duplicated list of profilers.
2011-11-19 10:23:06 -08:00
Nicolas Despres
b79f3fcef9 Fix compilation warning with getopt() on MinGW. 2011-11-19 18:56:15 +01:00
Nicolas Despres
657a0b919f Fix compilation warning with getopt_long() on MinGW. 2011-11-19 18:56:08 +01:00
Nicolas Despres
6be76e56b7 Use more portable way to get the current process ID.
GetProcessId() is available only since Windows XP.  Since
MinGW define WINVER to 0x0400 which is Windows 2000 I think, we have
a compilation error.  Using GetCurrentProcessId() instead of
GetProcessId(GetCurrentProcess()) fix this issue.
2011-11-19 18:56:00 +01:00
Nicolas Despres
69fe05f242 Fix duplicated list of profilers. 2011-11-19 15:48:30 +01:00
Evan Martin
f54e73ffb3 Merge pull request #132 from nico/spell
Add spelling suggestions for four cases:
2011-11-16 13:21:46 -08:00
Nico Weber
f72a4137f5 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.
2011-11-15 21:42:34 -08:00
Evan Martin
d838f8ed07 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.
2011-11-13 12:48:32 -08:00
Nico Weber
d0a3c5c373 Add a EditDistance() function based on the one in llvm/lib/Support/StringRef.cpp. 2011-11-13 12:17:53 -08:00
Evan Martin
04097eb434 Merge pull request #131 from secondplanet/patch-1
Improvements to ninja-mode
2011-11-13 12:16:09 -08:00
Humza
88fbad50ae Improvements to ninja-mode
* provide ninja-mode feature
* highlight rule names
2011-11-13 11:30:10 -05:00
Evan Martin
21dfa6d7aa Merge pull request #127 from tiresdonexits/master
Minor code change to address a warning in g++ 4.6.
2011-11-05 17:02:06 -07:00
Jonathan Sternberg
8bd34c5379 Added a cast to NULL to remove a warning issues by g++ 4.6. 2011-11-05 15:58:51 -04:00
Evan Martin
ed6f49372d Merge pull request #123 from pcc/commands-tool
Add a "commands" tool
2011-11-04 16:31:35 -07:00
Peter Collingbourne
4836a86466 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.
2011-11-04 19:10:31 +00:00
Evan Martin
801377e065 Merge pull request #125 from pcc/outputs-ready
CMake requirements: Make-style order-only dependencies, restat rules
2011-11-01 23:26:33 -07:00
Evan Martin
bb52198d19 don't leak fds into subprocesses
Patch from Antoine Labour <piman@chromium.org>, (hacky) test by me.
2011-10-31 15:39:53 -07:00
Evan Martin
a621299093 move SetCloseOnExec to util 2011-10-31 15:39:53 -07:00