Commit Graph

37 Commits

Author SHA1 Message Date
Michael Hirsch
aa9317e42f
cmake: add browse check status 2021-02-23 14:36:15 -05:00
Jan Niklas Hasse
5c93343406
Merge pull request #1331 from ilor/missingdeps3
missingdeps tool, take 2
2021-02-23 10:08:48 +01:00
Jan Niklas Hasse
ec8de9c247
Merge pull request #1915 from jhasse/windows-utf8
Use UTF-8 on Windows 10 Version 1903, fix #1195
2021-02-23 10:00:23 +01:00
Tomasz Śniatowski
3030254733 Add a -t missingdeps tool to detect some classes of build flakes
The tool looks for targets that depend on a generated file, but do not
properly specify a dependency on the generator. It needs to be run after
a successful build, and will list all potential flakes that may have
broken the build, but didn't due to accidental build step ordering.

The search relies on the correctness of depfile and generator output
information, but these are usually easier to get right than dependencies.

The errors found can usually be verified as actual build flakes by trying
to build the listed problematic files alone in a clean build directory.
Such builds usually fail with a compile job lacking a generated file.

There is some overlap between this tool and 'gn check', but not everyone
uses gn, not everyone using gn uses gn check, and most importantly, gn
check is more about modularity, and less about actual build-time deps
without flakes.

The tool needs to be run after a build completes and depfile data is
collected. It may take several seconds to process, up to a dozen or
two on a large, chromium-sized build.
2021-02-22 23:48:58 +01:00
Jan Niklas Hasse
c83f00c8a6
Merge pull request #1911 from eszlari/cmake-cleanup
cmake: add_compile_options / PROJECT_SOURCE_DIR
2021-02-22 23:31:17 +01:00
Jan Niklas Hasse
00459e2b44 Use UTF-8 on Windows 10 Version 1903, fix #1195
Allows Ninja to use descriptions, filenames and environment variables
with characters outside of the ANSI codepage on Windows. Build manifests
are now UTF-8 by default (this change needs to be emphasized in the
release notes).

WriteConsoleOutput doesn't support UTF-8, but it's deprecated on newer
Windows 10 versions anyway (or as Microsoft likes to put it: "no longer
a part of our ecosystem roadmap"). We'll use the VT100 sequence just as
we do on Linux and macOS.

https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page
https://docs.microsoft.com/en-us/windows/console/writeconsoleoutput
https://docs.microsoft.com/de-de/windows/console/console-virtual-terminal-sequences
2021-02-17 21:59:20 +01:00
Peter Eszlari
6118f74838 cmake: add_compile_options / PROJECT_SOURCE_DIR 2021-02-09 13:57:23 +01:00
Colin Cross
589f5b2497 Turn BuildStatus into an interface
Make BuildStatus an abstract interface, and move the current
implementation to StatusPrinter, to make way for a serialized
Status output.
2020-12-18 12:38:29 -08:00
Gregor Jasny
721db105e6 cmake: Use modern add_test signature
Using this modern signature makes CMake/CTest use the effective
binary path and works also with multi-config generators which put
binaries in extra `Release` folders.
2020-12-11 08:36:26 +01:00
Jan Niklas Hasse
7705fedfaf
Merge pull request #1876 from orgads/msvc-warnings
Suppress MSVC warnings
2020-12-05 23:41:02 +01:00
Jan Niklas Hasse
a30ccaef73
Merge pull request #1879 from kadler/aix-cleanup
Fix building on AIX
2020-11-14 16:03:41 +01:00
Kevin Adler
92fc37555f
Fix test crashes on AIX
Both hash_collision_bench and manifest_parser_perftest crash on AIX with

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
IOT/Abort trap (core dumped)

32-bit AIX applications by default allocates only a single 256M segment
for stack and heap for 32-bit applications, which is insufficient for
these tests. When building these tests on AIX in 32-bit mode, increase
the max number of segments so they will run without crashing.
2020-11-13 15:40:51 -06:00
Kevin Adler
b52970e86b
Add libperfstat to AIX CMake build 2020-11-13 15:40:51 -06:00
Kevin Adler
1cb029b33c
Use internal getopt for IBM i and AIX 2020-11-13 15:40:51 -06:00
hdf89shfdfs
8cf4a393fa Fix mulit-configuration bug. This affected users who use
multi-configuration generators for building ninja.
2020-11-13 07:07:02 -05:00
Orgad Shaneh
d709a37d14 Suppress MSVC warnings
* D9025: overriding '/GR' with '/GR-'
* C4100: 'argc': unreferenced formal parameter
* C4244: '=': conversion from 'int' to 'char', possible loss of data (on tolower)
* C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
* C4702: unreachable code (after Fatal)
* C4706: assignment within conditional expression
* C4996: 'strcpy': This function or variable may be unsafe
2020-11-11 13:52:54 +02:00
Nathan Mulcahey
f92b5b61f3 cmake: Use ${CMAKE_COMMAND} instead of cmake
Not all users have `cmake` on their PATH and this causes a build
failure.
2020-11-03 08:41:20 -08:00
Jesse Gorzinski
e74884f026 fixup: remove unneeded CMAKE_C_FLAGS 2020-10-29 10:33:49 -05:00
Jesse Gorzinski
5203aa49ed build: Add IBM i compile/link flags 2020-10-29 10:00:47 -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
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
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
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
Michael Hirsch, Ph.D
418d59b8a6 only apply optional flags when compiler works 2020-04-06 02:38:13 -04: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
rezso
34d1bf2f1d Add install target to CMake build 2020-02-08 19:08:06 +01:00
Jan Niklas Hasse
f2cf7a45c0 CMake: Use static MSVC runtime, fixes #1692 2020-01-17 23:38:12 +01:00
crondog
c6c607ee7e Build performance tests with CMake. Fixes #1708
They are only built and not run with CTest
2020-01-08 21:43:35 +11:00
Michael Jones
0c84b0ebd7 Enable Link Time Optimization for Release builds (#1701) 2019-12-03 22:46:56 +01:00
Helenerineium
288f04eb17 Fix warnings on mingw build 2019-11-23 17:47:44 +08:00
Sibi
980bc03f53 Fixed compilation by gcc on Windows 2019-11-02 17:43:58 +05:30
Jan Niklas Hasse
21bd971ea9 CMake: Bump required version for object libraries 2019-09-21 23:44:42 +02:00
Jan Niklas Hasse
71c2cf3905 CMake: Let MSVC correctly report __cplusplus 2019-09-21 23:05:30 +02:00
Jan Niklas Hasse
6f27f9642c CMake: Fix Windows build 2019-08-28 10:01:32 +02:00
Jan Niklas Hasse
691b821c90 CMake: Support building without re2c 2019-08-28 10:01:32 +02:00
Jan Niklas Hasse
ec6e7c7a77 Add CMake build file as an alternative to configure.py 2019-08-28 10:01:32 +02:00