Commit Graph

30830 Commits

Author SHA1 Message Date
Brad King
9f7c6a67e5 Merge topic 'update-kwsys'
1b6fbdf1d7 Merge branch 'upstream-KWSys' into update-kwsys
fc5b7905ed KWSys 2021-06-02 (ad35b3ba)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6183
2021-06-03 08:06:32 -04:00
Brad King
bf0d56a1fb Merge topic 'depfile-no-vstlog'
f0e9d74a2d cmake_transform_depfile: Remove unused incomplete vstlog support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6182
2021-06-03 08:05:42 -04:00
Kitware Robot
2ff2085fb8 CMake Nightly Date Stamp 2021-06-03 00:01:11 -04:00
Brad King
1b6fbdf1d7 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2021-06-02 (ad35b3ba)
2021-06-02 07:46:47 -04:00
Brad King
f0e9d74a2d cmake_transform_depfile: Remove unused incomplete vstlog support
In commit b2c14bc774 (cmake -E: Add cmake_transform_depfile internal
command, 2020-10-02, v3.20.0-rc1~684^2~2) a partial implementation for
converting MSBuild "TLog" format files was added.  However, it is
unused and incomplete:

* Does not enforce absolute paths as TLog docs require.
* Does not upper-case paths as TLog docs recommend.
* The TLog format semantics are not equivalent to `out: in`.

Remove the unused TLog transform infrastructure to avoid confusion.

Issue: #20286
2021-06-02 07:41:05 -04:00
Brad King
cf470d8dac Merge topic 'command_target'
1cb4f592a0 add_custom_command: Target-dependent generator expression support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6176
2021-06-02 07:39:44 -04:00
Brad King
399a321a64 Merge topic 'get-runtime-dependencies-file-filter'
a12639e658 file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6170
2021-06-02 07:38:17 -04:00
Kitware Robot
2104cfe388 CMake Nightly Date Stamp 2021-06-02 00:01:11 -04:00
Kyle Edwards
a12639e658 file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES arguments 2021-06-01 09:02:33 -04:00
Brad King
02957bb589 Merge topic 'install-imported-runtime-artifacts'
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode
60e752ced8 Refactor: Move common methods into cmInstallGenerator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6162
2021-06-01 08:42:16 -04:00
Brad King
5eb2aa1f57 Merge topic 'link-objects-first'
3941555d93 target_link_libraries: Place $<TARGET_OBJECTS> before libraries
f530b3a267 OpenWatcom: Add infrastructure to link to object files
8a4ca110e4 cmComputeLinkInformation: Improve type safety of item IsPath member
83ad066ed1 cmComputeTargetDepends: Factor out helper to add object library dependency
7f506b95a7 cmGeneratorTarget: Refactor link item lookup
96809a8541 cmGeneratorTarget: Give temporary link impl item an explicit name
ddffbb8adb cmMakefile: Register explicit object sources more efficiently
18e42d3e63 cmGeneratorExpressionNode: Constify local variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6166
2021-06-01 08:35:56 -04:00
Kitware Robot
76d583accd CMake Nightly Date Stamp 2021-06-01 00:01:10 -04:00
Kyle Edwards
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS 2021-05-31 09:02:45 -04:00
Kyle Edwards
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode 2021-05-31 09:02:45 -04:00
Kyle Edwards
60e752ced8 Refactor: Move common methods into cmInstallGenerator 2021-05-31 08:41:44 -04:00
Raul Tambre
1cb4f592a0 add_custom_command: Target-dependent generator expression support
OUTPUT variant with a TARGET given to allow resolving target-based generator
expressions wouldn't work because OUTPUT is resolved before generator targets
are created, i.e. FindGeneratorTargetToUse() returns nullptr.
This is a known limitation, see #21364.

Implements #21336.
2021-05-31 10:39:58 +03:00
Kitware Robot
7ed2a1a66f CMake Nightly Date Stamp 2021-05-31 00:01:22 -04:00
Kitware Robot
bf4e494773 CMake Nightly Date Stamp 2021-05-30 00:01:09 -04:00
Brad King
6da12f2611 Merge topic 'linker-launcher'
ae108418ae Launchers: Support setting linker launchers
92c8b83641 cmNinjaNormalTargetGenerator: Fix "Language" rule variable
d93bfd95f8 Tests/CompilerLauncher: Fix file names and clarify comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6092
2021-05-29 09:48:42 -04:00
Brad King
37cda77d16 Merge topic 'fix-compile-db-crash'
316cbbe8d5 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6173
2021-05-29 09:45:33 -04:00
Brad King
3941555d93 target_link_libraries: Place $<TARGET_OBJECTS> before libraries
Linkers always use object files explicitly specified on the command line
regardless of where they appear.  Move them to the front of the list of
linked libraries in so that symbols required by the object files can be
resolved by any library.

Issue: #22149
2021-05-29 09:28:36 -04:00
Brad King
f530b3a267 OpenWatcom: Add infrastructure to link to object files 2021-05-29 09:28:36 -04:00
Brad King
8a4ca110e4 cmComputeLinkInformation: Improve type safety of item IsPath member
Use an enum to avoid implicit conversions to bool.
2021-05-29 09:28:35 -04:00
Kitware Robot
7676e11943 CMake Nightly Date Stamp 2021-05-29 00:01:14 -04:00
Brad King
316cbbe8d5 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule
Extend the fix from commit 67e2130c96 (Makefiles: Fix
CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule,
2020-11-20, v3.19.1~8^2) to work for the `<FLAGS>` placeholder too.
Also fix the test case to actually enable `EXPORT_COMPILE_COMMANDS`
on the test target.

Fixes: #22261
2021-05-28 15:41:38 -04:00
Brad King
83ad066ed1 cmComputeTargetDepends: Factor out helper to add object library dependency 2021-05-28 15:25:28 -04:00
Brad King
7f506b95a7 cmGeneratorTarget: Refactor link item lookup
Look up items individually so the call sites can do something with the
result besides appending to a vector.
2021-05-28 14:27:38 -04:00
Brad King
96809a8541 cmGeneratorTarget: Give temporary link impl item an explicit name 2021-05-28 14:27:38 -04:00
Brad King
ddffbb8adb cmMakefile: Register explicit object sources more efficiently
`AddTargetObject` knows the location of object files.
2021-05-28 14:27:38 -04:00
Brad King
18e42d3e63 cmGeneratorExpressionNode: Constify local variable 2021-05-28 14:27:38 -04:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Bobby D Reynolds
92c8b83641 cmNinjaNormalTargetGenerator: Fix "Language" rule variable
Fixes: commit 3bc63e99e4 (Refactor: Prepare Ninja generator for multi-config, 2019-11-14, v3.17.0-rc1~290^2~3)
2021-05-28 12:28:43 -04:00
Brad King
4523da9a12 Merge topic 'vs-toolset-version'
a60141feaa VS: Add special case for '-T version=14.29.16.10' under VS 16.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6169
2021-05-28 12:24:52 -04:00
Kitware Robot
c186dfcd01 CMake Nightly Date Stamp 2021-05-28 00:01:11 -04:00
Brad King
a60141feaa VS: Add special case for '-T version=14.29.16.10' under VS 16.10
Extend the table of special cases from commit 58a50a3a0a (VS: Fix '-T
version=14.28' under VS 16.9, 2021-03-11, v3.19.7~1^2~1).  Add a special
case for the name VS 16.11 will use for VS 16.10's default toolset, so
that it can be used with VS 16.10 too.

Using '-T version=14.29.16.10' actually works under VS 16.10 without
this change, but only because there is only one 14.29 toolset so the
two-component prefix happens to match the right one.  Make it explicit.

Issue: #21922
2021-05-27 17:06:27 -04:00
Brad King
13d112ea03 CMake 3.20.3 2021-05-27 14:05:04 -04:00
Brad King
34a5163fec Merge topic 'xcode-link-TARGET_OBJECTS'
2ae72ef74b Xcode: Enable multi-arch TARGET_OBJECTS genex in [INTERFACE_]LINK_LIBRARIES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6161
2021-05-27 09:10:30 -04:00
Kitware Robot
e55c86873e CMake Nightly Date Stamp 2021-05-27 00:01:13 -04:00
Craig Scott
445c73d3fa Merge topic 'cpack-install-opts'
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6141
2021-05-26 18:53:40 -04:00
Brad King
2ae72ef74b Xcode: Enable multi-arch TARGET_OBJECTS genex in [INTERFACE_]LINK_LIBRARIES
This was an oversight in the original implementation.
2021-05-26 15:43:38 -04:00
Brad King
c5657a2fe4 Merge topic 'ninja-absolute-paths'
c564a3e3ff Ninja: Always compile sources using absolute paths
eb98d45111 Ninja: Handle depfiles with absolute paths to generated files in Ninja < 1.7
48471cfd18 cmNinjaNormalTargetGenerator: Factor out build event byproduct collection
18408c0b88 cmGlobalNinjaGenerator: Add helper to compute absolute paths for build.ninja
efb8d7b4a1 cmNinjaTargetGenerator: Reduce string copies in ConvertToNinjaPath wrapper
fb3a57575a cmNinjaTargetGenerator: Rename source file path lookup method for clarity
0f2b1c9d1b cmNinjaTargetGenerator: Remove GetSourceFilePath call with different semantics
dfc98774a2 cmNinjaTargetGenerator: Rename local variable for clarity
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6148
2021-05-26 11:57:22 -04:00
Kitware Robot
c6e36f6059 CMake Nightly Date Stamp 2021-05-26 00:01:43 -04:00
Brad King
c564a3e3ff Ninja: Always compile sources using absolute paths
The Ninja generator traditionally referenced source files and include
directories using paths relative to the build directory if they could be
expressed without a `../` sequence that leaves the build and source
directories.  For example, when using a `build/` directory inside the
source tree, sources would be compiled as `-c ../src.c` and include
directories would be referenced as `-I ../include`.  This approach
matches the traditional Ninja convention of using relative paths
whenever possible, but has undesirable side effects such as:

* Compiler diagnostic messages may not use absolute paths, making it
  harder for IDEs/editors to find the referenced sources or headers.

* Debug symbols may not use absolute paths, making it harder for
  debuggers to find the referenced sources or headers.

* Different results depending on the path to the build tree relative
  to the source tree.

* Inconsistent with the Makefile generators, which use absolute paths.

Switch to always using absolute paths to reference source files and
include directories on compiler command lines.  While alternative
solutions for diagnostic messages and debug symbols may exist with
specific tooling, this is the simplest and most consistent approach.

Note that a previous attempt to do this in commit 955c2a630a (Ninja: Use
full path for all source files, 2016-08-05, v3.7.0-rc1~275^2) was
reverted by commit 666ad1df2d (Revert "Ninja: Use full path for all
source files", 2017-02-24, v3.8.0-rc2~9^2) due to problems hooking up
depfile dependencies on generated files.  This time, the changes in
commit 2725ecff38 (Ninja: Handle depfiles with absolute paths to
generated files, 2021-05-19) should avoid those problems.

Fixes: #13894, #17450
2021-05-25 10:48:26 -04:00
Brad King
eb98d45111 Ninja: Handle depfiles with absolute paths to generated files in Ninja < 1.7
Extend the change from commit 2725ecff38 (Ninja: Handle depfiles with
absolute paths to generated files, 2021-05-19) to work on versions of
Ninja that do not support implicit outputs.  Specify the absolute paths
as normal outputs on such versions.

Issue: #13894, #21865
2021-05-25 10:48:26 -04:00
Brad King
48471cfd18 cmNinjaNormalTargetGenerator: Factor out build event byproduct collection
This was left out of commit 68e5f92cad (cmGlobalNinjaGenerator: Factor
out custom command output collection, 2021-05-18).
2021-05-25 10:48:26 -04:00
Brad King
18408c0b88 cmGlobalNinjaGenerator: Add helper to compute absolute paths for build.ninja 2021-05-25 10:48:25 -04:00
Brad King
efb8d7b4a1 cmNinjaTargetGenerator: Reduce string copies in ConvertToNinjaPath wrapper
The global generator's method returns a reference to a cached value.
Return that from the wrapper too.
2021-05-25 10:48:25 -04:00
Brad King
fb3a57575a cmNinjaTargetGenerator: Rename source file path lookup method for clarity
The `GetSourceFilePath` method is meant only for compiled sources, and
automatically handles converting it to a path for the Ninja build
manifest.  Rename the method to clarify both.
2021-05-25 10:48:25 -04:00
Brad King
0f2b1c9d1b cmNinjaTargetGenerator: Remove GetSourceFilePath call with different semantics
Reference external object files using `ConvertToNinjaPath` directly.
`GetSourceFilePath` is meant to reference source files to be compiled.
2021-05-25 10:48:25 -04:00
Brad King
dfc98774a2 cmNinjaTargetGenerator: Rename local variable for clarity 2021-05-25 10:48:25 -04:00