Commit Graph

33889 Commits

Author SHA1 Message Date
Kitware Robot
cecdd470a9 CMake Nightly Date Stamp 2023-03-30 00:01:08 -04:00
Brad King
f3e348b62e Merge topic 'install-namelink-no-rpath'
9c14f14848 install(TARGETS): Do not apply installation tweaks to NAMELINK files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8370
2023-03-29 09:15:56 -04:00
Kitware Robot
79a8f6da5d CMake Nightly Date Stamp 2023-03-29 00:01:08 -04:00
Brad King
9c14f14848 install(TARGETS): Do not apply installation tweaks to NAMELINK files
These files are symlinks to the real binaries, and we already apply
tweaks to those.  Previously we generated installation tweak code
guarded by a `NOT IS_SYMLINK` condition that is never true.  Drop the
code altogether.

Add a test covering the motivating use case, in which a `POST_BUILD`
step modifies the namelink file to not actually be a symlink.

Fixes: #24647
2023-03-28 12:06:24 -04:00
Brad King
f4b8176447 Merge topic 'lint-genex'
099934e313 Add generator expression support to static code analysis hooks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8361
2023-03-28 08:18:43 -04:00
Brad King
0b2b89cd93 Merge topic 'mingw-slashes'
a67cd9c39c Ninja: Restore slash style for MinGW tools when extra languages are enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8368
2023-03-28 08:11:09 -04:00
Kitware Robot
3726584a28 CMake Nightly Date Stamp 2023-03-28 00:01:08 -04:00
Brad King
a67cd9c39c Ninja: Restore slash style for MinGW tools when extra languages are enabled
Since commit f3ca199c9b (cmGlobalNinjaGenerator: Factor out GNU-like
command-line detection on Windows, 2023-03-18, v3.26.1~2^2~6), we
accidentally "unrecognize" MinGW tools on Windows if a language other
than C or CXX is enabled.  This causes the wrong slash style to be
generated in paths in `build.ninja`.

Fixes: #24642
2023-03-27 18:20:23 -04:00
Stefan Schober
099934e313 Add generator expression support to static code analysis hooks
Teach target properties `<LANG>_CPPCHECK`, `<LANG>_CPPLINT`,
`<LANG>_CLANG_TIDY` and `<LANG>_INCLUDE_WHAT_YOU_USE` to accept
generator expressions.
2023-03-27 11:48:41 -04:00
Brad King
367aa65a9f Merge topic 'module-depends-static-lib-cycle'
01d7860fdb Ninja,Makefile: Restore Fortran module scanning in static library cycle
846baa7c5b cmGlobalGenerator: Factor out helper to check target ordering

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8363
2023-03-27 09:51:59 -04:00
Kitware Robot
d0ba947070 CMake Nightly Date Stamp 2023-03-27 00:01:22 -04:00
Kitware Robot
12a185a268 CMake Nightly Date Stamp 2023-03-26 00:01:05 -04:00
Kitware Robot
6171ea1764 CMake Nightly Date Stamp 2023-03-25 00:01:06 -04:00
Brad King
01d7860fdb Ninja,Makefile: Restore Fortran module scanning in static library cycle
Since

* commit eed295fd8a (cmGlobalNinjaGenerator: require that dependency info
                     files work, 2023-02-01, v3.26.0-rc1~1^2~1), and
* commit 13810dee17 (cmDependsFortran: require that dependency info files
                     work, 2023-02-01, v3.26.0-rc1~1^2),

the Ninja and Makefile generators' module dependency scanning requires
that scanning results from from linked targets is available before
scanning the current target.  In the case of a static library cycle,
we cannot expect this information from other static libraries in the
cycle.  Previously we supported cyclic cases at the cost of silently
ignoring missing information.

We already compute a global order of targets that respects all
`add_dependencies`, but may break `target_link_libraries` dependencies
that occur in a static library cycle.  Use this order to filter the
linked targets so we only expect scanning results to be available from
those targets that build before the current target.

This approach is sufficient to support module dependency scanning in
static library cycles as long as module dependencies do not cross
between two libraries in the same cycle.

Fixes: #24631
2023-03-24 15:57:52 -04:00
Brad King
846baa7c5b cmGlobalGenerator: Factor out helper to check target ordering 2023-03-24 15:57:52 -04:00
Brad King
89b73ba980 Merge topic 'file-GET_RUNTIME_DEPENDENCIES-windows-casing'
fa45594407 file(GET_RUNTIME_DEPENDENCIES): Preserve casing for Windows PE binaries
14cfd6a1eb Tests: Add test for file(GET_RUNTIME_DEPENDENCIES) with MixedCase.dll

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8291
2023-03-24 09:36:00 -04:00
Kitware Robot
c4c4ca0e87 CMake Nightly Date Stamp 2023-03-24 00:01:05 -04:00
Christian Heimlich
fa45594407 file(GET_RUNTIME_DEPENDENCIES): Preserve casing for Windows PE binaries
For Windows PE files the `file(GET_RUNTIME_DEPENDENCIES)` command
converts the name of all  DLLs found during binary scanning to
lowercase in order to simplify the syntax requirements of its regex
filters; however, this has the side-effect of causing all DLL paths
returned via RESOLVED_DEPENDENCIES_VAR to be in lowercase, regardless
of their actual casing.

Instead, respect the original casing as closely as possible when
returning resolved dependencies after all filters have been
passed:

When evaluating a Windows PE format binary on a non-Windows host
the casing of dependencies recorded within the binary are
used. When the host is running Windows, the actual casing of the
dependencies on-disk are used instead.

Fixes: #23091
2023-03-23 15:19:26 -04:00
Brad King
fae6e8c2cd CMake 3.26.1 2023-03-23 09:12:04 -04:00
Brad King
5386dc582b Merge topic 'autogen-exe-vars'
b3d1797508 Autogen: Add CMAKE_AUTO*_EXECUTABLE variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8352
2023-03-23 08:46:45 -04:00
Kitware Robot
841c1844e1 CMake Nightly Date Stamp 2023-03-23 00:01:05 -04:00
Orkun Tokdemir
b3d1797508 Autogen: Add CMAKE_AUTO*_EXECUTABLE variables
Add the `CMAKE_AUTOMOC_EXECUTABLE`, `CMAKE_AUTOUIC_EXECUTABLE`, and
`CMAKE_AUTORCC_EXECUTABLE` variables to initialize the corresponding
`AUTO{MOC,UIC,RCC}_EXECUTABLE` target properties.

Fixes: #20071
2023-03-22 07:31:56 -04:00
Kitware Robot
941f31a890 CMake Nightly Date Stamp 2023-03-22 00:01:15 -04:00
Brad King
cb41fc469b Merge topic 'autogen-parallel-number'
a42ecb1614 Autogen: Restore AUTOGEN_PARALLEL support for numbers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8336
2023-03-21 09:06:52 -04:00
Brad King
926501c42a Merge topic 'file-REAL_PATH'
1d12853ed3 file(REAL_PATH): Ensure same behavior as get_filename_component(REALPATH)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8348
2023-03-21 09:05:56 -04:00
Brad King
e05dcdf246 Merge topic 'find_package-raii-fc-early-return'
716ce4402a find_package: Ensure root path stack and module vars are restored

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8339
2023-03-21 09:04:40 -04:00
Brad King
ca8c171021 Merge topic 'clang-windows-cxx-modules'
1b7c26da49 Ninja: Wrap rules using '>' shell redirection with 'cmd /C' on Windows
ffd8537acf Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end
6013227230 cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows
d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS
edab56d29a cmLocalNinjaGenerator: De-duplicate condition for using 'cmd /C' on Windows
8ebe3f92b3 cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collator
f3ca199c9b cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows
f79817fcf0 cmCxxModuleMapper: Use value semantics in path conversion callback
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8346
2023-03-21 08:58:43 -04:00
Kitware Robot
88efbdab5f CMake Nightly Date Stamp 2023-03-21 00:01:11 -04:00
Brad King
1b7c26da49 Ninja: Wrap rules using '>' shell redirection with 'cmd /C' on Windows
This is needed for the clang-scan-deps rule added by commit 0e21e55fc5
(Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end,
2023-03-16).

Fixes: #24611
2023-03-20 13:13:30 -04:00
Orkun Tokdemir
a42ecb1614 Autogen: Restore AUTOGEN_PARALLEL support for numbers
Refactoring in commit d867e05892 (Autogen: Use JSON instead of CMake
script for info files, 2019-09-20, v3.16.0-rc1~57^2) broke support for
numerical values of `AUTOGEN_PARALLEL`.  Parse and verify the range.
Warn if the value is invalid.

Fixes: #20376
2023-03-20 12:10:01 -04:00
Marc Chevrier
1d12853ed3 file(REAL_PATH): Ensure same behavior as get_filename_component(REALPATH)
Fixes: #24605
2023-03-20 14:14:11 +01:00
Kitware Robot
d0cc1d9bf9 CMake Nightly Date Stamp 2023-03-20 00:01:27 -04:00
Kitware Robot
54d64dc6dd CMake Nightly Date Stamp 2023-03-19 00:01:09 -04:00
Brad King
6013227230 cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows
Issue: #24611
2023-03-18 11:52:42 -04:00
Brad King
d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS
These were left from an older design iteration in which, for MSVC, we
needed to distinguish `cl -internalPartition` from `cl -interface`
before scanning.  It is no longer needed since `cl -scanDependencies`
was updated to use the standard-conforming interpretation of
non-exported module partition syntax.

Issue: #24611
2023-03-18 11:52:42 -04:00
Brad King
edab56d29a cmLocalNinjaGenerator: De-duplicate condition for using 'cmd /C' on Windows 2023-03-18 11:52:41 -04:00
Brad King
8ebe3f92b3 cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collator
This will help the collator choose flags and path styles for modmap
files.
2023-03-18 11:52:41 -04:00
Brad King
f3ca199c9b cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows 2023-03-18 11:52:41 -04:00
Brad King
f79817fcf0 cmCxxModuleMapper: Use value semantics in path conversion callback
The call site already owns a path it doesn't need when the callback
returns.  Hand ownership to the callback so it can optionally mutate
the path without necessarily allocating.
2023-03-18 11:52:41 -04:00
Brad King
5ab002ea11 cmCxxModuleMapper: Remove redundant path conversion callbacks
Two calls to `PathForGenerator` were applied to values returned by
`BmiGeneratorPathForModule`, that already calls `PathForGenerator`.
2023-03-18 11:52:41 -04:00
Kitware Robot
c3110a500e CMake Nightly Date Stamp 2023-03-18 00:01:21 -04:00
Craig Scott
716ce4402a find_package: Ensure root path stack and module vars are restored
Fixes: #24595
2023-03-17 21:35:30 +11:00
Kitware Robot
5f0c71da32 CMake Nightly Date Stamp 2023-03-17 00:01:12 -04:00
Brad King
2c2c2c2227 Merge topic 'vs-windows-min-version'
6546305b01 VS: Add CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8319
2023-03-16 09:11:07 -04:00
Brad King
737e97e069 Merge topic 'vs-BuildInParallel'
4c866cac40 VS: Do not regenerate build system concurrently with CMP0147

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8329
2023-03-16 09:08:45 -04:00
Brad King
b0076f3f49 Merge topic 'apple-archs'
98e319a88f macOS: Suppress default '-arch arm64' with CMAKE_<LANG>_COMPILER_TARGET
43e973eba2 cmGeneratorTarget: Pass language to GetAppleArchs when possible
93afe804ce cmGeneratorTarget: Convert GetAppleArchs output argument to return value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8327
2023-03-16 09:07:39 -04:00
Kitware Robot
9d439e235c CMake Nightly Date Stamp 2023-03-16 00:01:17 -04:00
Brad King
4c866cac40 VS: Do not regenerate build system concurrently with CMP0147
The VS generators add a custom command to `CMakeLists.txt` to re-run
CMake when input files have changed.  Mark this custom command as if it
were specified with `USES_TERMINAL`.  We already do this for the
equivalent `rebuild_cache` target in Makefile and Ninja generators.

This matters since commit d6353e74b4 (VS: Add policy to build custom
commands concurrently, 2023-03-10) because with policy CMP0147 set to
NEW, we now add `BuildInParallel` in `.vcxproj` file entries for custom
commands that do not have `USES_TERMINAL` set, but we do not want to
re-run CMake concurrently with other custom commands.

Issue: #18405
2023-03-15 14:33:36 -04:00
Brad King
98e319a88f macOS: Suppress default '-arch arm64' with CMAKE_<LANG>_COMPILER_TARGET
Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple
Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we add `-arch arm64` by
default on Apple Silicon hosts if `CMAKE_OSX_ARCHITECTURES` is not set.
This is necessary to prevent the toolchain from selecting its own
default architecture based on that of the build tool (e.g., `x86_64`).

If `CMAKE_<LANG>_COMPILER_TARGET` is set, its `-target` flag tells the
compiler what architecture to use, so do not add `-arch arm64`.

Fixes: #24599
2023-03-15 10:50:26 -04:00
Brad King
43e973eba2 cmGeneratorTarget: Pass language to GetAppleArchs when possible 2023-03-15 10:18:41 -04:00