Since commit d4d0dd0f6a (cmLinkLineComputer: Add ComputeLinkLibs
overload with backtraces, 2019-09-13, v3.16.0-rc1~87^2~4), backtraces
have been collected by `ComputeLinkLibs` by looking back through the
link implementation libraries for one matching the text of the link line
item. This is slow in projects with long link lines.
Instead, teach `cmComputeLinkDepends` and `cmComputeLinkInformation` to
carry backtrace information explicitly along with the text of each item.
Fixes: #20322
Fix an issue where CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG is specified
and CMAKE_NMC_CROSS_CONFIGS is not, which results in a false error
with CMAKE_NMC_DEFAULT_CONFIGS.
bd4ae2af0f Help: Make note of ninja -f argument in Ninja Multi-Config docs
79e5b3c46a Help: Explain new behavior of cmake --build in Ninja Multi-Config
16a4ba5b31 Ninja Multi-Config: Use build.ninja if cmake --build has no --config
2ac835b9f9 Refactor: Allow generators to decide default configuration for build
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4323
VS 2017 version 15.8 introduced support for unity builds implemented
in part by the `$(VCTargetsPath)/Microsoft.Cpp.Unity.targets` file.
Do not enable unity builds on VS 15 versions that do not have that file.
Fixes: #20284
llvm-rc requires preprocessed rc files. The CMake command line tool
cmake_llvm_rc enables channing the preprocessor call and the resource
compiler and make this appear as single compilation step.
When llvm-rc is detected as resource compiler, the RC compilation step
is set to use this command.
afcd9fe669 AIX: Add an option to disable automatic exports from shared libraries
67f30811ce AIX: Improve name of internal symbol export list file
0ffd54f094 AIX: Add ExportImportList option to skip the object files
0dcfb63cb9 AIX: Revise ExportImportList to build output more incrementally
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4308
This adds logic to properly handle Swift executables. Only executables
marked as exporting symbols will now generate module interfaces for the
executable.
If no tests were found, the default behavior of CTest is to always log an
error message but to return an error code in script mode only. This option
unifies the behavior of CTest by either returning an error code if no tests
were found or by ignoring it.
Signed-off-by: Stefan Dinkelacker <s.dinkelacker@dkfz-heidelberg.de>
The CPack OSXX11 generator has not had any updates since 2011 except as
part of sweeping maintenance changes. It also creates packages with a
OSXScriptLauncher binary that has only ppc and i386 architectures which
are not supported by Apple anymore. Furthermore, the generator is not
even mentioned in our documentation. Add a deprecation warning.
Fixes: #20235
Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports
for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export
all symbols from shared libraries by default. Add a new target property
called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to
suppress this behavior and export no symbols by default.
Fixes: #20290
Since commit f6f4eb0907 (clang-tidy: Add driver mode argument,
2020-01-19) the `clang-tidy` tool rejects the new option:
Unknown command line argument '--driver-mode=g++'.
This is because we are adding the flag before the main compiler
command-line. Encode it with `--extra-arg-before=` so that `clang-tidy`
knows it is supposed to be part of the compiler command.
Suggested-by: Hanjiang Yu
aebfbcaa46 AutoGen: Use depfiles for the XXX_autogen ninja targets
f765fdea03 AutoGen: Use moc's feature to output dependencies
f8c505d4b3 Add a parser for GCC-style depfiles
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jan Niklas Hasse <jhasse@bixense.com>
Merge-request: !4221
Extend the fix from commit 0578239d3a (VS: Tell VS 16.4 not to verify
SYMBOLIC custom command outputs, 2019-09-23, v3.15.4~2^2) to apply to
SYMBOLIC *inputs* too. This is needed when there is a chain of custom
commands that use symbolic paths for ordering.
Fixes: #20179
ccaa0bccc4 Ninja: Do not clean metadata when re-generating inside a running build
657820a00b Ninja: Track when running to re-generate during a build
b12b013028 Ninja: Factor metadata cleanup into dedicated method
5d92e60d81 Ninja: Skip cleandead and recompact if build.ninja is missing
dd0a4718fd Ninja: Fix CMAKE_NINJA_OUTPUT_PATH_PREFIX with Ninja 1.10
0944caaebb Tests: Fix RunCMake.CMP0037 test with Ninja 1.10
9d4883cce5 Tests: Fix RunCMake.Ninja test for Ninja 1.10
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4290
The XXX_autogen targets are implemented as utility commands, which
means they always run, even if there weren't any changes.
For the Ninja generator and Qt >= 5.15 we're taking a different
approach: This commit adds custom commands that create
XXX_autogen/timestamp files. Those custom commands have a depfile
assigned that is generated from the depfiles that were created by moc.
The XXX_autogen targets merely wrap the XXX_autogen/timestamp custom
commands.
Fixes: #18749
In Qt version 5.15.0 moc learned to output the dependencies
of the generated file.
This commit enhances JobCompileMocT to read the dependency file
written by moc. The dependencies are stored in the same cache that's
used for the dependencies determined by dependency filters.
The dependency filter functionality is turned off if moc's dependency
output feature is used.
Fixes: #17750Fixes: #19058
Introduce the function cmReadGccDepfile that parses a GCC-style depfile
and returns its content. The implementation uses a lexer that is
modeled after the re2c implementation in Ninja.
The sample files of the autotest have been created with gcc 8.3.0.
This depfile reader is to be used by the Autogen facility to make use
of the depfiles that are generated by Qt's meta object compiler.
When CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY is set on
Xcode generator created post build scripts which tried to call
XCODE_DEPEND_HELPER.make script in subproject.
But XCODE_DEPEND_HELPER.make don't exist in
subprojects when mentioned option is set on.
Fixes: #20262
Fixes#17559
Replace our hard-coded default of cudart=static with a first-class abstraction to select the runtime library from an enumeration of logical names.
When `ninja` re-runs CMake to re-generate the build system, do not try
to use the ninja tools to update metadata on Windows. The outer ninja
process is already holding the files open.
Issue: #20274
The ninja 1.10 tools we use since commit fb18215904 (Ninja: clean ninja
metadata once generated, 2019-05-13) expect `build.ninja` to be
available and loadable. In commit 6cc74b6140 (cmGlobalNinjaGenerator:
avoid cleandead and recompact in Ninja-Multi, 2020-01-22) we added a
condition to exclude the tools in a case where `build.ninja` is not
available. Generalize that condition using a local variable and extend
it for the case that `build.ninja` is not loadable in the current
directory because it is meant to be a sub-ninja for a higher directory.
QCC is a wrapper around GCC, but it is not a fully transparent wrapper.
Some compile options need to be passed to GCC using a `-Wc` option.
QCC does not support --sysroot, so setting CMAKE_SYSROOT in a toolchain
file currently does not work. This means that it is likely that no one
is setting CMAKE_SYSROOT in existing QNC toolchain files. Override the
GCC option for sysroot in the QCC.cmake file with -Wc,-isysroot.
This exposes a further issue in that the QNX SDK does not follow the
same architectural folder structure as linux uses. That is, on linux
systems, architecture-specific libraries might be in
<sysroot>/usr/lib/<arch>
such as
/usr/lib/x86_64-linux-gnu/libcurl.so
CMake models this by suffixing the <arch> onto lib directories when
searching for libraries.
The QNX SDK is structured differently such that the <arch> should be
used as a prefix:
<sysroot>/<arch>/usr/lib
such as
<sysroot>/x86_64/usr/lib/libcurl.so
Add a variable for platform configuration to set whether to prefix or
suffix the <arch> and set that in the QCC.cmake.
Use the directory structure of the QNX SDK to compute the <arch> from
the implicit library directories. The assumption is that the arch will
be a single directory directly below the CMAKE_SYSROOT, below which the
usr/ prefix occurs.
It would not be appropriate to instruct users to make the <arch> part of
the sysroot when specified in the toolchain file because:
1. That would be non-DRY - The QCC wrapper already determines the <arch>
by the -V argument passed to the compiler, specified in the toolchain
file as the CMAKE_C_COMPILER_TARGET variable.
2. The includes in the QNX SDK are not below the <arch> directory.
So, the location of the <arch> in the full path is different on QNX
compared to, say an embedded linux platform, but the intent is the same.
Add documentation to recommend the use of CMAKE_SYSROOT in a QNX
toolchain file.
As the CMAKE_SYSROOT is always the same for QNX, it would be possible to
simply set it in QCC.cmake. However, that would change behavior for
existing users as when CMAKE_SYSROOT is set, files/paths outside of the
CMAKE_SYSROOT do not get found.
The <arch> prefixing is only enabled in cmSearchPath.cxx if
CMAKE_SYSROOT is set. This ensures that the user gets consistency in
the current state without CMAKE_SYSROOT, and gets better consistency
when using CMAKE_SYSROOT.
`clang-tidy` does not infer driver mode if it is not provided with a
JSON compilation database. This is exactly the way cmake launches it.
Hence clang-tidy will only use the default driver mode. Add an explicit
driver mode argument to avoid this.
b7a2baf38c Ninja Multi-Config: Add variable to control configs used in cross-config build
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4269
When the `DEPENDS` option names a logical target name, convert to the
"real" path of that target rather than any of the symlink-provided
alternative file names. This makes the dependencies consistent with the
outputs named by link rules producing the target artifacts.
Fixes: #20264
These are not suffix rules and are not suppressed by the empty
`.SUFFIXES` recipe. Additionally, the old `SUFFIXES =` code didn't
actually accomplish this, so remove it.
Add the timestamp and stack depth of the function call to the JSON trace
output format. This information can be useful for cmake profiling and
call stack inspection (see e.g. https://github.com/volo-zyko/cmake-profile-stats).
Improve unit test to allow for varying set of keys to check in trace lines.
3ec82b713e cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache
701a5c60e0 cmake: avoid marking local or unused variables as advanced
af158149e7 FindOpenSSL: do not mark a local variable as advanced
74f659f1f2 FindCurses: only mark CURSES_EXTRA_LIBRARY when it is used
7e2ae4e96d FindOpenGL: only mark declared cache variables as advanced
7cc02a0c29 FindLua: only mark LUA_MATH_LIBRARY as advanced if required
85cd26b8a6 FindBoost: only mark Boost_DIR as advanced if defined
338c7916ba CTest: avoid marking undeclared cache variables as advanced
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4150