https://github.com/Kitware/CMake
Revision 0826c20128fad20aafac2006ac0371e381e3cf60 authored by Brad King on 25 April 2018, 14:53:15 UTC, committed by Brad King on 26 April 2018, 12:39:44 UTC
Internally we mark `file(GENERATE)` outputs as `GENERATED` in order
to tell custom command dependency tracing logic not to expect the
files to exist on disk yet.  This is because we do not generate the
files until after that tracing is done.

The Ninja generator also interprets the `GENERATED` property to mean
that it is expected that some build rule will generate the file if
another build rule depends on it.  If the generator does not know of a
custom command that generates the file then it adds an empty one so that
the `ninja` build tool does not complain about a dependency on a file
that does not exist and has no rule to generate it.  However, this step
is not necessary for `file(GENERATE)` outputs because there is no build
rule to generate them and they will exist before `ninja` runs.

Add an additional `__CMAKE_GENERATED_BY_CMAKE` property internally to
tell the Ninja generator that a `GENERATED` file will exist before the
build starts and is not expected to have a build rule producing it.

Fixes: #17942
1 parent fbe6cd1
History
Tip revision: 0826c20128fad20aafac2006ac0371e381e3cf60 authored by Brad King on 25 April 2018, 14:53:15 UTC
Ninja: Do not add empty custom command for file(GENERATE) outputs
Tip revision: 0826c20
File Mode Size
.github
Auxiliary
Help
Licenses
Modules
Packaging
Source
Templates
Tests
Utilities
.clang-format -rw-r--r-- 201 bytes
.clang-tidy -rw-r--r-- 969 bytes
.gitattributes -rw-r--r-- 1.1 KB
.gitignore -rw-r--r-- 64 bytes
.hooks-config -rw-r--r-- 418 bytes
CMakeCPack.cmake -rw-r--r-- 9.8 KB
CMakeCPackOptions.cmake.in -rw-r--r-- 12.4 KB
CMakeGraphVizOptions.cmake -rw-r--r-- 153 bytes
CMakeLists.txt -rw-r--r-- 30.6 KB
CMakeLogo.gif -rw-r--r-- 4.4 KB
CONTRIBUTING.rst -rw-r--r-- 2.1 KB
CTestConfig.cmake -rw-r--r-- 440 bytes
CTestCustom.cmake.in -rw-r--r-- 6.1 KB
CompileFlags.cmake -rw-r--r-- 2.7 KB
Copyright.txt -rw-r--r-- 5.0 KB
DartConfig.cmake -rw-r--r-- 374 bytes
README.rst -rw-r--r-- 3.0 KB
bootstrap -rwxr-xr-x 47.9 KB
cmake_uninstall.cmake.in -rw-r--r-- 790 bytes
configure -rwxr-xr-x 99 bytes
doxygen.config -rw-r--r-- 27.4 KB

README.rst

back to top