Refactor the local generator creation API to accept a
cmState::Snapshot. Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent. Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.
This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
Add .DELETE_ON_ERROR to the "build.make" files that contain the actual
build rules that generate files. This tells GNU make to delete the
output of a rule if the recipe modifies the output but returns failure.
This is particularly useful for custom commands that use shell
redirection to produce a file.
Do not add .DELETE_ON_ERROR for Borland or Watcom make tools because
they may not tolerate it and would not honor it anyway. Other make
tools that do not understand .DELETE_ON_ERROR will not be hurt.
Suggested-by: Andrey Vihrov <andrey.vihrov@gmail.com>
The Ninja build system does not support a in-file verbositiy switch.
Instead teach 'cmake --build' to extract the CMAKE_VERBOSE_MAKEFILE
setting and pass it as an optional '-v' argument to Ninja. This can
serve as a reasonable fallback.
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Implement it in terms of the ComputeObjectFilenames virtual method
on the local generators.
Remove the reimplementation from the global generators which are
now all functionally identical.
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.
The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
Add the .NOTPARALLEL target to each local Makefile command-line
interface entry point file so that even with -j we launch only
one "make -f Makefile2" at a time. The actual build rules
in Makefile2 and lower will still run in parallel.
Do not add .NOTPARALLEL for Borland or Watcom make tools because
they do not tolerate it. Other make tools that do not understand
.NOTPARALLEL will not be hurt.
Suggested-by: Robert Luberda <robert-cmake@debian.org>
All cmGlobalGenerator::GenerateBuildCommand call sites that need to
produce a string now generate "cmake --build" commands. The remaining
call sites immediately pass the result to cmSystemTools::RunSingleCommand.
Avoid the intermediate string and argument parsing by directly producing a
vector of strings. Also drop the ignoreErrors argument because no call
sites remain that use it.
Create a GenerateCMakeBuildCommand method to generate a command-line
string invoking "cmake --build" for a given target and configuration.
Optionally allow the "-i" make flag and additional native options.
Refactor edit_cache tool selection to ask each global generator for its
preference. Teach the Ninja generator to always use cmake-gui because
Ninja by design cannot run interactive terminal dialogs like ccmake.
Teach the Makefile generator to use cmake-gui when also using an "extra"
generator whose IDE has no terminal to run ccmake, and otherwise fall
back to CMAKE_EDIT_COMMAND selection for normal Makefile build systems.
Extend the cmGlobalGenerator::GenerateBuildCommand virtual method
signature with a "projectDir" parameter specifying the top of the
project build tree for which the build command will be generated.
Populate it from call sites in cmGlobalGenerator::Build where a
fully-generated build tree should be available.
Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked
during cmGeneratorTarget construction. Implement it in the Makefile
generator to pre-compute all object file names for each target. Use
the results during generation instead of re-computing it later.
Commit 8a0eb78f (Constify many getters of cmGlobalGenerator, 2011-03-26)
added const qualifiers to many cmGlobalGenerator methods but left the
resulting lines beyond our style's limit of 79 characters.
cdc2b41 Fix CompileCommandOutput test build on Windows
7039d1f Fix CompileCommandOutput test for Make tools not supporting spaces
4268e3d run_compile_commands: Cast istream::get() result to char
c45c60b run_compile_commands: Avoid extra stl vector conversion
7c5be51 run_compile_commands: Avoid shadow in std::map<>::at workaround
169bb05 Provide std::map<>::at for use in run_compile_commands
4e2185c Make std::map usage more portable in language=>flags/defines maps
a7e7a04 Fix run_compile_commands build on Apple GCC 3.3
c9174c0 Fix signed/unsigned comparison in EscapeJSON
8346a28 Only offer the compile command output feature on unix systems
0e6b05f Adds a test for the compile command line output.
5674844 make compile command output optional
fe07b05 implement cxx command output
65c0c24 cache flags and defines
3f064ef refactor flags and defines