Commit Graph

28419 Commits

Author SHA1 Message Date
Ben Boeckel
a85bea173a cmGlobalNinjaGenerator: avoid unnecessary string addition 2020-02-11 03:55:50 -05:00
Kitware Robot
d31f31714b CMake Nightly Date Stamp 2020-02-11 00:01:09 -05:00
Brad King
8752c1bd64 Merge branch 'backport-3.16-link-line-backtrace' 2020-02-10 16:17:03 -05:00
Brad King
e756328434 Propagate backtraces from LINK_LIBRARIES through to link line items
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
2020-02-10 16:11:38 -05:00
Brad King
205293d7eb Merge topic 'ninja-multi-depfile'
67102d3252 Ninja Multi-Config: Add support for DEPFILE option in add_custom_command()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4334
2020-02-10 10:39:49 -05:00
Kitware Robot
799bfb7132 CMake Nightly Date Stamp 2020-02-10 00:01:07 -05:00
Kitware Robot
cb967317e4 CMake Nightly Date Stamp 2020-02-09 00:01:05 -05:00
Kitware Robot
f77f64f793 CMake Nightly Date Stamp 2020-02-08 00:01:08 -05:00
Kyle Edwards
67102d3252 Ninja Multi-Config: Add support for DEPFILE option in add_custom_command()
And give other generators a path forward to add support in the future.
2020-02-07 14:18:54 -05:00
Brad King
3844e2ae4c Merge topic 'cmake-gui-env-platform-defaults'
9a71fa46e7 cmake-gui: set generator field defaults from environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4312
2020-02-07 10:37:35 -05:00
Brad King
4e44cbc673 Merge topic 'ninja-multi-default-config-fix'
1844be451e Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4331
2020-02-07 09:26:37 -05:00
Brad King
135378fd18 Merge topic 'ninja-multi-default-config-fix' into release-3.17
1844be451e Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4331
2020-02-07 09:26:36 -05:00
Brad King
6c142ac7aa Merge topic 'ninja-multi-no-minsizerel'
9e219de4fb Ninja Multi-Config: Don't include MinSizeRel by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4326
2020-02-07 09:17:26 -05:00
Kitware Robot
006aff6f87 CMake Nightly Date Stamp 2020-02-07 00:01:09 -05:00
Kyle Edwards
1844be451e Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG
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.
2020-02-06 14:31:13 -05:00
Code Smith
9a71fa46e7 cmake-gui: set generator field defaults from environment
Fixes: #20251
2020-02-06 11:59:08 -05:00
Kyle Edwards
9e219de4fb Ninja Multi-Config: Don't include MinSizeRel by default 2020-02-06 11:07:38 -05:00
Brad King
36926f5b8b Merge topic 'cmakefiles-rules-ninja'
65679ed8d9 Ninja: Move rules.ninja into CMakeFiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4328
2020-02-06 10:11:58 -05:00
Kitware Robot
6b659b0abd CMake Nightly Date Stamp 2020-02-06 00:01:11 -05:00
Kyle Edwards
65679ed8d9 Ninja: Move rules.ninja into CMakeFiles
Since this is an implementation detail, it should not be user-
visible. Move it into the implementation directory.
2020-02-05 13:52:54 -05:00
Brad King
b49e5344e7 Begin post-3.17 development 2020-02-05 11:39:33 -05:00
Brad King
13ef3285df Begin 3.17 release versioning 2020-02-05 11:37:19 -05:00
Brad King
44b8937b76 CMake 3.16.4 2020-02-05 09:19:24 -05:00
Brad King
56ddef613d Merge topic 'ninja-multi-cmake-build-no-config'
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
2020-02-05 09:11:10 -05:00
Brad King
94be195a54 Merge topic 'llvm-rc-preprocess'
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4219
2020-02-05 09:10:16 -05:00
Brad King
4b1a6a4722 Merge topic 'vs-version-for-unity' into release-3.16
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4324
2020-02-05 08:33:50 -05:00
Brad King
4b062c77b3 Merge topic 'vs-version-for-unity'
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4324
2020-02-05 08:33:50 -05:00
Kitware Robot
9a5fe4e48c CMake Nightly Date Stamp 2020-02-05 00:01:11 -05:00
Kyle Edwards
16a4ba5b31 Ninja Multi-Config: Use build.ninja if cmake --build has no --config
If cmake --build is called with no --config argument, and a
build.ninja file is available, use that instead of defaulting to the
Debug config.
2020-02-04 14:13:07 -05:00
Kyle Edwards
2ac835b9f9 Refactor: Allow generators to decide default configuration for build
And allow them to read any cache values they need.
2020-02-04 14:13:07 -05:00
Brad King
9135954e2f VS: Do not use native unity builds on VS 2017 versions less than 15.8
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
2020-02-04 11:46:18 -05:00
Brad King
ebea30a1ed CMake 3.15.7 2020-02-04 09:02:13 -05:00
Brad King
8b6b783633 Merge topic 'ninja-run-tool-in-builddir'
f4e02c46fc cmGlobalNinjaGenerator: run ninja tools in the build directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4319
2020-02-04 08:28:46 -05:00
Brad King
451ce7e410 Merge topic 'swift-exe-exports'
1e26d57188 Ninja: properly handle exports from Swift exes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4314
2020-02-04 08:27:49 -05:00
Thomas Bernard
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc
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.
2020-02-04 08:19:12 -05:00
Kitware Robot
f9410accaa CMake Nightly Date Stamp 2020-02-04 00:01:10 -05:00
Ben Boeckel
f4e02c46fc cmGlobalNinjaGenerator: run ninja tools in the build directory
Fixes: #20303
2020-02-03 15:31:26 -05:00
Brad King
5f04dfe57e Merge topic 'ninja-multi-variable-shuffle'
b966f86d86 Ninja Multi-Config: Shuffle variables around

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4305
2020-02-03 14:00:03 -05:00
Kyle Edwards
b966f86d86 Ninja Multi-Config: Shuffle variables around
Remove redundant variable CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE.
Rename other variables. Document and improve handling of error
conditions.
2020-02-03 13:27:51 -05:00
Kyle Edwards
25bf64eca6 Merge topic 'ctest-add-ignore-no-tests-option'
a39d4139d0 Add --no-tests=<[error|ignore]> option to CTest

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4258
2020-02-03 13:22:02 -05:00
Brad King
16d91cbf7e Merge topic 'fix_automoc_deps_rule_name'
7c664bb5b9 Fix AUTOMOC deps file to contain correct rule name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4313
2020-02-03 11:53:28 -05:00
Brad King
a19bc6ae39 Merge topic '7zip-fix'
34413cbf3f cmArchiveWrite: Remove ./ suffix from 7zip archives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4311
2020-02-03 11:49:39 -05:00
Brad King
3a17ef5f23 Merge topic 'cpack-deprecate-old-macos-generators'
2ed00e8ef8 CPack: Deprecate OSXX11 generator
7bf187499f CPack: Deprecate PackageMaker generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4309
2020-02-03 11:46:01 -05:00
Brad King
999a8663c5 Merge topic 'aix-no-export-all'
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
2020-02-03 11:32:01 -05:00
Brad King
ea5c6c3c86 Merge topic 'clang-tidy-driver-mode'
3aea865801 clang-tidy: Fix explicit --driver-mode= argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4307
2020-02-03 11:30:58 -05:00
Kitware Robot
20eeeeaa1a CMake Nightly Date Stamp 2020-02-03 00:01:05 -05:00
Kitware Robot
3a732a7dc3 CMake Nightly Date Stamp 2020-02-02 00:01:05 -05:00
Saleem Abdulrasool
1e26d57188 Ninja: properly handle exports from Swift exes
This adds logic to properly handle Swift executables.  Only executables
marked as exporting symbols will now generate module interfaces for the
executable.
2020-02-01 17:25:57 -08:00
Kitware Robot
7edad7bfa2 CMake Nightly Date Stamp 2020-02-01 00:01:08 -05:00
Alexandru Croitor
7c664bb5b9 Fix AUTOMOC deps file to contain correct rule name
The rule name should include the current binary path relative to
the top level binary path.

Fixes: #20298
2020-02-01 00:35:53 +01:00
Cristian Adam
34413cbf3f cmArchiveWrite: Remove ./ suffix from 7zip archives
Fixes: #20297
2020-01-31 22:32:04 +01:00
Stefan Dinkelacker
a39d4139d0 Add --no-tests=<[error|ignore]> option to CTest
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>
2020-01-31 18:17:13 +01:00
Brad King
2ed00e8ef8 CPack: Deprecate OSXX11 generator
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
2020-01-31 10:04:41 -05:00
Brad King
7bf187499f CPack: Deprecate PackageMaker generator
Xcode no longer distributes the PackageMaker tools.
Add a deprecation warning when the generator is used.

Issue: #20235
2020-01-31 10:04:31 -05:00
Brad King
afcd9fe669 AIX: Add an option to disable automatic exports from shared libraries
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
2020-01-31 09:34:06 -05:00
Brad King
3aea865801 clang-tidy: Fix explicit --driver-mode= argument
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
2020-01-31 09:00:52 -05:00
Kitware Robot
d70b71c14f CMake Nightly Date Stamp 2020-01-31 00:01:10 -05:00
Brad King
89a3d33d11 Merge topic 'automoc-using-depfiles'
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
2020-01-30 09:52:33 -05:00
Brad King
5be9a8cfd5 Merge topic 'std-string-cleanup'
bbc07e4561 Source: use std::string in place of const char*

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4299
2020-01-30 09:51:51 -05:00
Kitware Robot
7dd5ca66c9 CMake Nightly Date Stamp 2020-01-30 00:01:11 -05:00
Vitaly Stakhovsky
bbc07e4561 Source: use std::string in place of const char* 2020-01-29 14:31:01 -05:00
Brad King
f972b929d6 Merge topic 'vs-16.4-custom-command-inputs' into release-3.16
58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4297
2020-01-29 10:36:40 -05:00
Brad King
92f04d3790 Merge topic 'vs-16.4-custom-command-inputs'
58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4297
2020-01-29 10:36:40 -05:00
Brad King
38ee7db2ac Merge topic 'mixed-mode-multi-arch'
15f6606abd Swift: disallow multiple `CMAKE_OSX_ARCHITECTURES` with Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4283
2020-01-29 10:32:38 -05:00
Brad King
4b89232ffa Merge topic 'mf-json-type'
5a72ffb33a cmMakefile: Fix construction of Json::Value from fixed-size int types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4291
2020-01-29 10:21:24 -05:00
Kitware Robot
e13a858555 CMake Nightly Date Stamp 2020-01-29 00:01:14 -05:00
Brad King
3c5f0037f7 Merge branch 'vs-16.4-custom-command-inputs' into release-3.15
Merge-request: !4297
2020-01-28 13:59:27 -05:00
Brad King
58b0674687 VS: Tell VS 16.4 not to verify SYMBOLIC custom command inputs
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
2020-01-28 13:52:05 -05:00
Saleem Abdulrasool
15f6606abd Swift: disallow multiple CMAKE_OSX_ARCHITECTURES with Swift
This disallows the use of multiple values in `CMAKE_OSX_ARCHITECTURES`
with Swift which does not support FAT compilation.
2020-01-28 10:13:28 -08:00
Raul Tambre
5a72ffb33a cmMakefile: Fix construction of Json::Value from fixed-size int types
Cast to the Json-provided fixed-size integer types rather than assuming
that the `std::*` variants match.

Fixes: #20278
2020-01-28 11:47:33 -05:00
Brad King
228dc92b09 Merge topic 'mf-typo'
7b6af980eb cmMakefile: Fix spelling typo in comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4292
2020-01-28 11:40:02 -05:00
Brad King
a4d7a79beb Merge topic 'ninja-1.10'
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
2020-01-28 11:35:24 -05:00
Joerg Bornemann
aebfbcaa46 AutoGen: Use depfiles for the XXX_autogen ninja targets
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
2020-01-28 11:16:11 -05:00
Joerg Bornemann
f765fdea03 AutoGen: Use moc's feature to output dependencies
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: #17750
Fixes: #19058
2020-01-28 11:16:11 -05:00
Joerg Bornemann
f8c505d4b3 Add a parser for GCC-style depfiles
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.
2020-01-28 11:16:11 -05:00
Brad King
7706b6a714 Merge topic 'xcode-top-level-only-with-object-library'
64304fe72b Xcode: Fix post build script for 'top level project only' opt

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4284
2020-01-28 11:05:17 -05:00
Brad King
ee5edfbda2 Merge topic 'dot-dir'
830a7d8803 cmArchiveWrite: Remove ./ suffix from zip archives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4288
2020-01-28 11:04:30 -05:00
Brad King
cb8bd146c9 Merge topic 'modernize-memory-management'
b50b2755da cmComputeLinkInformation: modernize memory management

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4285
2020-01-28 11:03:34 -05:00
Brad King
193352e420 Merge topic 'clang-tidy-driver-mode'
f6f4eb0907 clang-tidy: Add driver mode argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4208
2020-01-28 11:01:19 -05:00
Brad King
e3be80f4fc Merge topic 'append-std-string'
1398517f31 AppendProperty: convert value param to std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4282
2020-01-28 11:00:16 -05:00
Brad King
b6da71e299 Merge topic 'osx-version-flags'
6a84f0b791 macOS: Test OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties
4a62e3d97c macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4274
2020-01-28 10:59:03 -05:00
Brad King
e4e41d33d6 Merge topic 'cmsting-stl-compatibility'
8f839d02e3 cm::String: enhance compatibility with STL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4281
2020-01-28 10:58:11 -05:00
Brad King
571205fb6b Merge topic 'QNX_CMAKE_SYSROOT'
32a6ab1f3b QNX: Add support for CMAKE_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4277
2020-01-28 10:56:41 -05:00
Masashi Fujita
7b6af980eb cmMakefile: Fix spelling typo in comment 2020-01-28 10:54:15 -05:00
Brad King
1f9321c683 Merge topic 'cuda_runtime_library_controls'
0d0145138f CUDA: Add abstraction for cuda runtime selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4178
2020-01-28 10:52:33 -05:00
Kitware Robot
03e2757c66 CMake Nightly Date Stamp 2020-01-28 00:01:07 -05:00
Yauheni Khnykin
64304fe72b Xcode: Fix post build script for 'top level project only' opt
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
2020-01-27 16:14:19 -05:00
Robert Maynard
0d0145138f CUDA: Add abstraction for cuda runtime selection
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.
2020-01-27 16:02:26 -05:00
Brad King
ccaa0bccc4 Ninja: Do not clean metadata when re-generating inside a running build
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
2020-01-27 15:39:04 -05:00
Brad King
657820a00b Ninja: Track when running to re-generate during a build
Tell CMake explicitly when it is re-running inside a `ninja` invocation
to re-generate the build system.
2020-01-27 15:39:04 -05:00
Brad King
b12b013028 Ninja: Factor metadata cleanup into dedicated method 2020-01-27 15:39:04 -05:00
Brad King
5d92e60d81 Ninja: Skip cleandead and recompact if build.ninja is missing
In error cases the `build.ninja` file may not exist.  Skip running ninja
tools that require it so that we do not generate additional errors.
2020-01-27 15:09:18 -05:00
Brad King
dd0a4718fd Ninja: Fix CMAKE_NINJA_OUTPUT_PATH_PREFIX with Ninja 1.10
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.
2020-01-27 15:09:18 -05:00
Stephen Kelly
32a6ab1f3b QNX: Add support for CMAKE_SYSROOT
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.
2020-01-27 14:04:56 -05:00
Hanjiang Yu
f6f4eb0907 clang-tidy: Add driver mode argument
`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.
2020-01-27 13:59:05 -05:00
Cristian Adam
830a7d8803 cmArchiveWrite: Remove ./ suffix from zip archives
Fixes: #20238
2020-01-27 16:53:46 +01:00
Brad King
f624b44524 Merge topic 'fix-ninja-multi-framework-header'
63c9cd2088 Ninja Multi-Config: Fix bug with MacOS frameworks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4279
2020-01-27 10:06:53 -05:00
Brad King
306328ace8 Merge topic 'depend-on-target-real-name'
08699cec68 add_custom_command: Fix dependency on macOS framework target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4273
2020-01-27 10:04:08 -05:00
Brad King
0bf9589bf1 Merge topic 'csharp-no-valued-macros'
effd4d0569 CSharp: Do not pass definitions with values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4267
2020-01-27 10:03:26 -05:00
Brad King
6f7f293562 Merge topic 'cpack-dmg-breaklongline'
4a3a7d5f5d CPack/DragNDrop: Fix word corruption in BreakLongLines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4275
2020-01-27 09:33:45 -05:00
Brad King
d5f5496783 Merge topic 'cpack-dmg-rtf-for-sla'
9571929701 CPack/DragNDrop: Support RTF licenses

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4270
2020-01-27 09:32:51 -05:00
Brad King
a9a1a7a325 Merge topic 'makefiles-suppress-vcs-implicit-rules'
879e56f336 makefiles: suppress RCS and SCCS implicit rules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4264
2020-01-27 09:29:58 -05:00
Kitware Robot
ee4299ce46 CMake Nightly Date Stamp 2020-01-27 00:01:05 -05:00
Marc Chevrier
b50b2755da cmComputeLinkInformation: modernize memory management 2020-01-26 14:01:45 +01:00
Kitware Robot
55ea8f6b1b CMake Nightly Date Stamp 2020-01-26 00:01:13 -05:00
Marc Chevrier
8f839d02e3 cm::String: enhance compatibility with STL 2020-01-25 18:16:16 +01:00
Vitaly Stakhovsky
1398517f31 AppendProperty: convert value param to std::string 2020-01-25 10:37:00 -05:00
Kitware Robot
33e7bd66c0 CMake Nightly Date Stamp 2020-01-25 00:01:08 -05:00
Kyle Edwards
63c9cd2088 Ninja Multi-Config: Fix bug with MacOS frameworks 2020-01-24 17:16:25 -05:00
Brad King
072a95350c Merge topic 'ninja-multi-cross-configs'
b7a2baf38c Ninja Multi-Config: Add variable to control configs used in cross-config build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4269
2020-01-24 15:02:20 -05:00
Sumit Bhardwaj
effd4d0569 CSharp: Do not pass definitions with values
The Microsoft C# tooling does not accept definitions with values.
Filter them out.

Fixes: #19817
2020-01-24 14:43:37 -05:00
Isuru Fernando
4a62e3d97c macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties
Fixes: #17652
2020-01-24 14:13:41 -05:00
Koray Kilinc
4a3a7d5f5d CPack/DragNDrop: Fix word corruption in BreakLongLines
When the lines are wrapped the leading characters of the next word were being lost
2020-01-24 09:17:12 -08:00
Brad King
08699cec68 add_custom_command: Fix dependency on macOS framework target
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
2020-01-24 11:29:45 -05:00
Brad King
786b56942b Merge topic 'vs-dotnet-standard-core'
ae1e1909a1 VS: Add support for .NET Standard and .NET Core

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4240
2020-01-24 10:55:26 -05:00
Andrew Fuller
9571929701 CPack/DragNDrop: Support RTF licenses 2020-01-24 07:48:52 -08:00
Brad King
816bbf227f Merge topic 'trace_json_timestamp'
c829f0cfca trace: Add time and stack level to JSON output format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Volo Zyko <volo.zyko@gmail.com>
Merge-request: !4242
2020-01-24 09:19:55 -05:00
Brad King
89a93348d5 Merge topic 'multi-ninja-no-cleandead'
6cc74b6140 cmGlobalNinjaGenerator: avoid cleandead and recompact in Ninja-Multi

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4261
2020-01-24 09:17:07 -05:00
Joerg Bornemann
ae1e1909a1 VS: Add support for .NET Standard and .NET Core
Fixes: #20105
2020-01-24 09:11:05 -05:00
Ben Boeckel
879e56f336 makefiles: suppress RCS and SCCS implicit rules
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.
2020-01-24 09:06:25 -05:00
Kitware Robot
55921df313 CMake Nightly Date Stamp 2020-01-24 00:01:06 -05:00
Kyle Edwards
b7a2baf38c Ninja Multi-Config: Add variable to control configs used in cross-config build 2020-01-23 15:47:12 -05:00
Kyle Edwards
ab2fc91821 Merge topic 'organize_makefile_help_output'
7c1470f146 Makefiles: Organize help output to group 'like' targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4260
2020-01-23 10:43:03 -05:00
Brad King
f0f7ea2bf5 Merge topic 'get-runtime-dependencies-keyword-args'
3573f62a16 Merge branch 'backport-get-runtime-dependencies-keyword-args'
c998c8d560 file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments
4c8a917a87 file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4262
2020-01-23 10:02:45 -05:00
Brad King
9771d231aa Merge topic 'ninja-multi-default-build-alias'
8337ed0d73 Ninja Multi-Config: Add variable to control aliases in build.ninja
110037369d Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninja
e62a3414f7 Refactor: Move common.ninja into CMakeFiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4238
2020-01-23 10:01:14 -05:00
Ben Boeckel
6cc74b6140 cmGlobalNinjaGenerator: avoid cleandead and recompact in Ninja-Multi
Fixes: #20247
2020-01-23 09:24:46 -05:00
Kitware Robot
9c87d051ad CMake Nightly Date Stamp 2020-01-23 00:01:09 -05:00
Kyle Edwards
c998c8d560 file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments
Also list all keywords that were missing values instead of only the
first one.
2020-01-22 14:34:33 -05:00
Robert Maynard
7c1470f146 Makefiles: Organize help output to group 'like' targets 2020-01-22 13:21:12 -05:00
Kyle Edwards
4c8a917a87 file(GET_RUNTIME_DEPENDENCIES): Tolerate empty list arguments
Also list all keywords that were missing values instead of only the
first one.
2020-01-22 13:05:46 -05:00
Kyle Edwards
8337ed0d73 Ninja Multi-Config: Add variable to control aliases in build.ninja 2020-01-22 10:26:21 -05:00
Kyle Edwards
110037369d Refactor: Split Ninja files into impl-<Config>.ninja and build-<Config>.ninja 2020-01-22 10:26:21 -05:00
Kyle Edwards
e62a3414f7 Refactor: Move common.ninja into CMakeFiles 2020-01-22 10:25:35 -05:00
Kyle Edwards
593d0f3a57 Merge topic 'ninja-restat-just-build.ninja'
eb2da206d9 cmGlobalNinjaGenerator: only restat build.ninja

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4245
2020-01-22 10:25:06 -05:00
Frank Winklmeier
c829f0cfca trace: Add time and stack level to JSON output format
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.
2020-01-22 09:58:52 -05:00
Brad King
15c573df41 Merge topic 'mark_as_advanced-without-cache'
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
2020-01-22 09:50:49 -05:00
Brad King
39695f6fb3 Merge topic 'modernize-memory-management'
edab5add57 cmMakefileTargetGenerator: modernize memory management

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4250
2020-01-22 09:49:30 -05:00
Brad King
3be2abd889 Merge topic 'install-std-string'
5e54b0cf2f cmInstallGenerator: std::string params

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4255
2020-01-22 09:40:32 -05:00
Brad King
3f601ebb0a Merge topic 'vs-std-string'
2e768924f3 cmLocalVisualStudio7Generator: clean up c_str()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4249
2020-01-22 09:24:57 -05:00
Kitware Robot
0877438599 CMake Nightly Date Stamp 2020-01-22 00:01:07 -05:00
Vitaly Stakhovsky
5e54b0cf2f cmInstallGenerator: std::string params
Several construction parameters converted to std::string
Also made a few class members const
2020-01-21 11:09:35 -05:00
Brad King
21e60da5bb CMake 3.16.3 2020-01-21 10:17:47 -05:00
Brad King
7a89e3c36c Merge topic 'install-std-string'
9db532f44d cmInstall*Generator: std::string params

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4241
2020-01-21 09:21:51 -05:00
Vitaly Stakhovsky
9db532f44d cmInstall*Generator: std::string params
Several construction parameters converted to std::string
Also made a few class members const
2020-01-21 09:19:13 -05:00
Ben Boeckel
eb2da206d9 cmGlobalNinjaGenerator: only restat build.ninja
This reduces the work that ninja needs to do on a CMake reconfigure.
2020-01-21 08:57:51 -05:00
Marc Chevrier
edab5add57 cmMakefileTargetGenerator: modernize memory management 2020-01-21 12:52:05 +01:00
Kitware Robot
2f7e76efa4 CMake Nightly Date Stamp 2020-01-21 00:01:16 -05:00
Ben Boeckel
3ec82b713e cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache
Fixes: #18331
2020-01-20 15:49:29 -05:00
Vitaly Stakhovsky
2e768924f3 cmLocalVisualStudio7Generator: clean up c_str() 2020-01-20 15:44:07 -05:00
Brad King
941c09616b Merge topic 'multi-ninja-pch'
a55df20499 Multi-Ninja: Add precompile headers support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4201
2020-01-20 11:59:28 -05:00