Commit Graph

33909 Commits

Author SHA1 Message Date
Brad King
2daba01ddf cmGeneratorTarget: Avoid incidental include-what-you-use warning
Avoid `warning: Extra tokens on pragma line` from IWYU.
2023-04-05 16:12:15 -04:00
Kitware Robot
02f23be9a7 CMake Nightly Date Stamp 2023-04-03 00:01:20 -04:00
Kitware Robot
17b8d01e22 CMake Nightly Date Stamp 2023-04-02 00:01:07 -04:00
Kitware Robot
063c07e097 CMake Nightly Date Stamp 2023-04-01 00:01:07 -04:00
Brad King
17e6b2bdca Merge topic 'automoc-cxx-standard'
429a452705 Autogen: Add target's C++ standard to moc_predef.h
21f812e57c Autogen: Split creation and setup of custom targets into separate steps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8359
2023-03-31 08:09:06 -04:00
Brad King
fb37de96a0 Merge topic 'remove-FindPythonInterp-FindPythonLibs'
a4c5b91f80 FindPython{Interp,Libs}: Add policy to remove these modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8380
2023-03-31 08:08:18 -04:00
Brad King
ae9f725b9b Merge topic 'cuda-arch-nvcc-options-file'
6546da83b3 CUDA: Fix CUDA architecture flags for nvcc response files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !8379
2023-03-31 08:05:10 -04:00
Brad King
61681128e1 Merge topic 'presets-add-trace'
8e579b0228 presets: Add trace options to configure presets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8254
2023-03-31 08:03:58 -04:00
Brad King
2159906731 Merge topic 'strip-macos'
689616785f macOS: Do not pass Apple-specific flags to llvm-strip

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8374
2023-03-31 08:02:20 -04:00
Kitware Robot
f52a2fd26d CMake Nightly Date Stamp 2023-03-31 00:01:07 -04:00
Brad King
a4c5b91f80 FindPython{Interp,Libs}: Add policy to remove these modules
The `FindPythonInterp` and `FindPythonLibs` modules have been deprecated
since CMake 3.12.  Add a policy to pretend they do not exist in order to
encourage projects to port to `FindPython` or `FindPython{2,3}`.
2023-03-30 12:05:09 -04:00
Brad King
6546da83b3 CUDA: Fix CUDA architecture flags for nvcc response files
`nvcc --options-file` does not parse unquoted arguments in a response
file correctly if they contain `[]`.  Quote the `--generate-code=` flags
we add for CUDA architectures.

Fixes: #24657
2023-03-30 09:43:01 -04:00
Artin Alavi
8e579b0228 presets: Add trace options to configure presets
Add JSON schema version 7 to support them.

Fixes: #22543
2023-03-30 09:18:53 -04:00
Brad King
4901fdb201 Merge topic 'presets-json-errors'
19305afd8a presets: Improve JSON parser and error messages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8290
2023-03-30 08:51:18 -04:00
Brad King
dfe32d797e Merge topic 'ninja-performance'
426f3295f6 Ninja: Use more efficient data structures to collect outputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8371
2023-03-30 07:19:05 -04:00
Orkun Tokdemir
429a452705 Autogen: Add target's C++ standard to moc_predef.h
Generate `moc_predef.h` using the same C++ standard level that will be
used to compile the target so that the compiler's predefined macros can
be more accurately recovered.

Fixes: #24624
Qt-Issue: https://bugreports.qt.io/browse/QTBUG-110847
2023-03-30 06:41:51 -04:00
Kitware Robot
cecdd470a9 CMake Nightly Date Stamp 2023-03-30 00:01:08 -04:00
Brad King
689616785f macOS: Do not pass Apple-specific flags to llvm-strip
Since commit cf82300a63 (BinUtils: Clarify search logic and make it more
consistent, 2021-05-27, v3.21.0-rc1~119^2~2) we prefer `llvm-strip` over
`strip` when using Clang.  However, since commit 20291e8e72 (install:
Fix stripping on macOS, 2019-01-30, v3.14.0-rc1~31^2) on macOS we add
flags `-u -r`, needed by Apple's `strip` for executables, but that
`llvm-strip` does not need or support.  Improve the condition to add
Apple-specific flags only when the selected `strip` tool is Apple's.

Note that Apple dylibs must be stripped with `-x` with either Apple's
`strip` or `llvm-strip`.

Fixes: #24601
2023-03-29 15:19:47 -04:00
Martin Duffy
19305afd8a presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -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
Nicolas van Kempen
426f3295f6 Ninja: Use more efficient data structures to collect outputs 2023-03-28 17:53:18 -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
Orkun Tokdemir
21f812e57c Autogen: Split creation and setup of custom targets into separate steps
Defer the setup step until after compile features have been finalized on
normal targets.  Later this will help pass the information to Qt tools.

Issue: #24624
2023-03-24 12:23:47 -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