Commit Graph

2652 Commits

Author SHA1 Message Date
Michael Jones
a5aae85a3c Remove 'using namespace std' from header files, properly namespace all std symbols 2020-09-30 16:19:11 -05:00
Michael Jones
ff4f2a0db2 Add 'using namespace std;' to all cc files to prepare for removing it from header files 2020-09-30 11:19:09 -05:00
David Callu
54959b0f2c
cmake: add BUILD_TESTING option (ON by default) (#1839)
option provided by cmake's Module CTest
enable_testing() is call by this Module
2020-09-14 12:39:13 +02:00
Jan Niklas Hasse
8cd857188e
Merge pull request #1789 from neheb/if
[clang-tidy] fix small false positive
2020-09-10 14:06:17 +02:00
Jan Niklas Hasse
04b6445907
Merge pull request #1786 from neheb/memb
[clang-tidy] remove redundant member init
2020-09-10 14:04:08 +02:00
Jan Niklas Hasse
2f3e5275e2
Merge pull request #1836 from aharrison24/cmake-browse-mode-support
CMake: Add support for "browse" mode
2020-08-28 15:11:44 +02:00
Alastair Harrison
0b5f5ba910 CMake: Add platform checks for browse mode support
Browse mode requires a number of POSIX features to be available.
This commit adds configure-time checks that the 'unistd.h' header is
available and that the `inline.sh` script executes successfully. If the
checks pass then browse mode is enabled.
2020-08-28 12:18:58 +01:00
Alastair Harrison
67f960be1b Improve error handling in inline.sh
Previously the script would generate some output and return a zero
error code, even if the calls to `od` or `sed` failed.

This change ensures that:
- If `od` or `sed` fail then the script will fail.
- Output will only be written on success.
2020-08-28 12:18:55 +01:00
Jan Niklas Hasse
727863bb0f
Merge pull request #1823 from serpent7776/patch-1
Use c++ instead of g++
2020-08-27 23:56:13 +02:00
Alastair Harrison
5b80abbc72 CMake: Add support for "browse" mode
Fixes ninja-build/ninja#1822, fixes ninja-build/ninja#1853

Adds support for `ninja -t browse` to CMake builds.

The platform support logic is copied from configure.py, so Windows,
Solaris and AIX are treated as 'unsupported' platforms. All other
platforms are assumed to be supported.

As discussed in #1853, when built via CMake the `ninja` executable
looks for a binary called `python` in the current path, in order to
launch the "browse" mode. The behaviour differs from that of the
configure.py script, which looks for a python executable that has the
*same name* as the python executable that invoked the configure script.
2020-08-27 21:50:35 +01:00
Jan Niklas Hasse
9ddd3c9177 Mark this 1.10.1.git 2020-08-18 21:24:50 +02:00
Jan Niklas Hasse
00968321d6
Merge pull request #1780 from jhasse/delay-open
Delay actually opening log files until the first write, fix #1724
2020-08-03 12:48:17 +02:00
Krzysztof Leśniak
6c5fc1d4ec
Use c++ instead of g++
`configure.py` assumes `g++` is present on the system, which is not the case, e.g. for FreeBSD.
`c++` should be used insted, which should be a link to system c++ compiler. This will be `g++` for linux, but `clang++` for FreeBSD.
2020-08-01 17:04:14 +02:00
David Callu
086a9b2f88 cmake: use PROJECT_{SOURCE,BINARY}_DIR instead of CMAKE_{SOURCE,BINARY}_DIR
CMAKE_SOURCE_DIR refer to the full path to the top level of the current
CMake source tree
PROJECT_SOURCE_DIR refer to the source directory of the last call to the
project() command made in the current directory scope or one of its parents

when ninja is use as a subproject, the build fail because of this.
2020-07-17 09:56:32 +02:00
Dimitris Apostolou
6c5e886aac Fix typos 2020-07-07 13:00:22 +02:00
Nico Weber
48a9fb5d0d
Merge pull request #1804 from ninja-build/nico-patch-2
Include sys/select.h in subprocess-posix.cc
2020-06-21 19:21:51 -04:00
Nico Weber
89984d5729
Merge pull request #1803 from ninja-build/nico-patch-1
Include unistd.h in disk_interface.cc
2020-06-21 19:21:14 -04:00
Nico Weber
b191404828
Include sys/select.h in subprocess-posix.cc
pselect() is in sys/select.h in "newer" (2001) versions of posix, so add an include for it.

While here, only include poll.h if USE_PPOLL is defined.
2020-06-21 18:37:46 -04:00
Nico Weber
580f57fe77
Include unistd.h in disk_interface.cc
stat() needs unistd.h in addition to sys/stat.h and sys/types.h per POSIX.
At least one (hobby) OS does need unistd.h, so add an include for it.
2020-06-21 18:32:02 -04:00
Rosen Penev
0ab46c5918
[clang-tidy] fix small false positive
else if has to be on the same line it seems.

Found with readability-misleading-indentation

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-17 17:27:26 -07:00
Rosen Penev
7e678b5d4d
[clang-tidy] remove redundant member init
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-17 17:25:54 -07:00
Jan Niklas Hasse
8948ec2de6 GitHub Actions: Switch to MSVC's subdirectory 2020-06-15 09:39:05 +02:00
Jan Niklas Hasse
86d30f775d
GitHub Actions: PowerShell requires \ instead of / 2020-06-15 09:26:20 +02:00
Jan Niklas Hasse
76ea0462a3
GitHub Actions: Run ninja_test directly (Windows) 2020-06-15 09:19:40 +02:00
Rosen Penev
be6c7afcd1
[clang-tidy] check empty instead of size (#1784)
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-04 09:47:37 +02:00
Rosen Penev
a32a2087b6
[clang-tidy] remove pointless c_str() (#1785)
Found with readability-redundant-string-cstr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-04 09:46:43 +02:00
Jan Niklas Hasse
ea9f736100 Add missing Apache license header, fix #1781 2020-05-25 10:58:34 +02:00
Jan Niklas Hasse
cc79afbc05 Delay actually opening log files until the first write, fix #1724
Calling DepsLog/BuildLog::OpenForWrite will now only save the file path.
The actual opening of the file (moved to OpenForWriteIfNeeded) happens
right before the first write attempt.

This is needed so that the files aren't held open when the generator
runs (i.e. RebuildManifest) as it may call tools like recompact which
won't be able to open the file on Windows.

The disadvantage is that now the error reporting happens at a later time
and will be reported as a failed write, not a failed open.
2020-05-23 18:44:25 +02:00
zero9178
52649de2c5
bugfix: Process escaped colon in GCC depfiles. (#1774)
* Added ability to parse escaped colons in GCC Dep files enabling ninja to parse dep files of GCC 10 on Windows

* Added generated depfile_parser.cc

* Addressed formatting

* Added extra tests with real world examples of paths produced by both GCC 10 and Clang and GCC pre 10. Adjusted one test so it doesn't fail

* Adjusted regular expression to not match \: if the character following the : is either EOF or whitespace

* Fixed typo in regex (should be 0x20 for space not 0xa)

* Changed regular expression form using lookahead to instead matching a separate expression. This was needed as re2c pre version 1.17 is broken when using lookaheads. Also added tests for \: followed by whitespace

* Addressed formatting

* Forgot a missing std::

* Fixed formatting for spaces after , as well as respecting column width
2020-05-20 14:38:36 +02:00
Jan Niklas Hasse
cf021f32e6 MinGW now has _mktemp_s, use overload with size parameter
MSVC also used the custom implementation, since the function isn't a
macro and therefore

  #ifndef _mktemp_s

didn't work as intended.
2020-05-18 11:57:34 +02:00
Jan Niklas Hasse
c6148b0c33 GitHub Actions: Run ninja_test directly 2020-05-14 11:07:24 +02:00
Jan Niklas Hasse
9a77d91952
Merge pull request #1769 from scivision/pytest_win
test: skip non-Windows tests if on Windows
2020-04-30 14:47:44 +02:00
Michael Hirsch, Ph.D
e44fcbede9
test: skip non-Windows tests if on Windows 2020-04-27 11:39:48 -04:00
Jan Niklas Hasse
112217185e Add output test for 'no work to do.' 2020-04-24 12:58:20 +02:00
Jan Niklas Hasse
8ca068c395
Merge pull request #1765 from past-due/macos_deployment_target_1
macOS workflow: specify the minimum version of macOS supported
2020-04-18 10:45:40 +02:00
past-due
b91ceb65c8 Add MACOSX_DEPLOYMENT_TARGET to macos workflow 2020-04-17 20:21:03 -04:00
Jan Niklas Hasse
7d00661c1b
Merge pull request #1763 from nomadbyte/master
Null terminate the out2 string passed as filter2 to log.Restat
2020-04-15 09:10:42 +02:00
yydevelop
5fa5f1c15c Null terminate the out2 string passed as filter2 to log.Restat 2020-04-14 19:58:58 -05:00
Jan Niklas Hasse
7c556be510 Turn CONTRIBUTING.md into a link 2020-04-06 16:05:27 +02:00
Jan Niklas Hasse
64ebbcb31a
Merge pull request #1748 from scivision/opts
enable Intel, IBM XL, and PGI compilers without header/source changes
2020-04-06 09:01:47 +02:00
Michael Hirsch, Ph.D
418d59b8a6 only apply optional flags when compiler works 2020-04-06 02:38:13 -04:00
Jan Niklas Hasse
8900fa55b5
Merge pull request #1637 from beevik/windows-create-process-fix
Improve error messages when ninja commands fail on Windows.
2020-03-26 22:55:26 +01:00
Jan Niklas Hasse
b50e1e3bc6
Merge pull request #1756 from floppym/readme
Replace references to README with README.md
2020-03-23 14:20:56 +01:00
Mike Gilbert
b748d08561 Replace references to README with README.md
The README file was renamed to README.md in commit
a37da20ae7.
2020-03-20 19:38:26 -04:00
Jan Niklas Hasse
1f3cc7b720
Merge pull request #1742 from scivision/cmake
CMake: modernize
2020-03-03 11:10:02 +01:00
Michael Hirsch, Ph.D
ea16698e0a
cmake: append instead of set(x ...) 2020-02-20 22:14:27 -05:00
Michael Hirsch, Ph.D
e6f5bcffb3
cmake: remove redundant cmake_policy()
cmake_minimum_required(VERSION 3.15) implicitly sets to NEW all
policies from CMP0094 and older
2020-02-20 22:14:27 -05:00
Jan Niklas Hasse
2ca4c711f7
Merge pull request #1744 from scivision/htmlesc
browse.py: use html.escape for python3
2020-02-20 11:08:20 +01:00
Jan Niklas Hasse
39cf5266dd
Merge pull request #1745 from scivision/ciupdate
CI: update CMake use
2020-02-20 11:07:24 +01:00
Michael Hirsch, Ph.D
f24d01e83c
ci: use latest checkout action 2020-02-19 06:05:44 -05:00