Commit Graph

33312 Commits

Author SHA1 Message Date
Kitware Robot
b92d0971db CMake Nightly Date Stamp 2022-11-25 00:01:06 -05:00
Kitware Robot
93ded7304a CMake Nightly Date Stamp 2022-11-24 00:01:11 -05:00
Brad King
c924d33bec Merge topic 'cxxmodule-module-support-tweaks'
c53748cc09 Tests/RunCMake/CXXModules: mark IMPORTED targets as INTERFACE
a971fcfde7 cmNinjaNormalTargetGenerator: use `cmStrCat`
b7509d6bf8 cmNinjaNormalTargetGenerator: fix grammar in verbose comment
0015cb95de cmGlobalNinjaGenerator: fix comment typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7943
2022-11-23 07:10:52 -05:00
Brad King
af937d2933 Merge topic 'try_compile-copy-config'
80fc564dd7 try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !7948
2022-11-23 07:09:10 -05:00
Brad King
7c462e36c9 Merge topic 'XCode-XCODE_LINK_BUILD_PHASE_MODE-and-LINK_LIBRARY-genex'
61075d2d7b XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7947
2022-11-23 07:08:01 -05:00
Kitware Robot
7c39301ebf CMake Nightly Date Stamp 2022-11-23 00:01:14 -05:00
Brad King
80fc564dd7 try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATION
Since commit 0c141b0393 (try_compile: Record output location instead of
reverse computing it, 2022-08-31, v3.25.0-rc1~154^2) we always look for
the "Debug" configuration's output binary from the test project.
Restore looking for the `CMAKE_TRY_COMPILE_CONFIGURATION`.

Fixes: #24180
2022-11-22 11:26:28 -05:00
Marc Chevrier
61075d2d7b XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE
Fixes: #24176
2022-11-22 16:44:45 +01:00
Brad King
1f6a6d6aad Merge topic 'use-rsp-in-makefiles'
b1a3a38e03 Makefiles: Name object response files with .rsp extension

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: kossnikita <kossnikita@gmail.com>
Merge-request: !7942
2022-11-22 09:48:53 -05:00
Brad King
62172b4ab7 Merge topic 'custom-command-comment-genex'
26d813092b add_custom_{command,target}: add genex support for COMMENT
60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7887
2022-11-22 09:47:59 -05:00
Kitware Robot
9278ae6f1b CMake Nightly Date Stamp 2022-11-22 00:01:17 -05:00
Ben Boeckel
a971fcfde7 cmNinjaNormalTargetGenerator: use cmStrCat 2022-11-21 17:12:18 -05:00
Ben Boeckel
b7509d6bf8 cmNinjaNormalTargetGenerator: fix grammar in verbose comment 2022-11-21 17:09:33 -05:00
Ben Boeckel
0015cb95de cmGlobalNinjaGenerator: fix comment typo 2022-11-21 17:09:33 -05:00
Felipe Torrezan
b1a3a38e03 Makefiles: Name object response files with .rsp extension
This is more consistent with the Ninja generator, and is necessary
for the IAR linker to recognize the argument as a response file.

Fixes: #24165
2022-11-21 10:29:24 -05:00
Brad King
e69251c828 Merge topic 'xcode-ios-extensionkit'
b99c386122 Xcode: Allow bundling extensionkit extensions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7900
2022-11-21 10:06:20 -05:00
Brad King
55e3168dc4 Merge topic 'lang-std-flag-order'
a1c20b08b4 cmLocalGenerator: Inline AddCompilerRequirementFlag in only call site
914571a042 Place language standard flags just after CMAKE_<LANG>_FLAGS
ad16ae5c70 VS: Recognize -std: flag in CMAKE_C_FLAGS in target with C++ sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7931
2022-11-21 10:03:35 -05:00
Brad King
973d88c25f Merge topic 'clang-tidy-module-cmstrlen-check-sizeof'
830eed374d CMake: fix sizeof string literal violations
c6368a23fe clang-tidy module: look for sizeof string literal in cmStrLen() check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7927
2022-11-21 10:01:14 -05:00
Brad King
fa7afe5eb3 Merge topic 'cxx-scanning-properties'
a02d792c6e cxxmodules: add properties to control scanning
008c09d6db cmNinjaTargetGenerator: factor out determining the fileset of a source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7935
2022-11-21 10:00:12 -05:00
Kitware Robot
a0dbfb99aa CMake Nightly Date Stamp 2022-11-21 00:01:15 -05:00
Kitware Robot
55c7a1f1ad CMake Nightly Date Stamp 2022-11-20 00:01:07 -05:00
Peter Würth
26d813092b add_custom_{command,target}: add genex support for COMMENT
Evaluate and expand generator expressions in the `COMMENT` argument of
the `add_custom_command()` and `add_custom_target()` commands.
This allows to include generator expressions, e.g. a targets location
$<TARGET_...> or the current configuration $<CONFIG>, in the build-time
messages.

Fixes #22507
2022-11-19 13:32:56 +01:00
Peter Würth
60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string
Refactoring was done because EvaluateComment leaked memory.
2022-11-19 13:32:56 +01:00
Kitware Robot
d8c8e61633 CMake Nightly Date Stamp 2022-11-19 00:01:10 -05:00
Russell Greene
b99c386122 Xcode: Allow bundling extensionkit extensions
Fixes: #24150
2022-11-18 13:58:03 -06:00
Brad King
a1c20b08b4 cmLocalGenerator: Inline AddCompilerRequirementFlag in only call site
The call site in `AddLanguageFlags` is now the "one true place" for
adding language standard flags.  Inline the helper to reduce risk of
adding other call sites later.
2022-11-18 11:44:52 -05:00
Brad King
914571a042 Place language standard flags just after CMAKE_<LANG>_FLAGS
Previously we added the language standard flag near the end of all
options, even after those added by `add_compile_options` and friends.
However, on some compilers such as MSVC, the `-std` flag may reset
defaults for flags that precede it on the command line.  Move the
language standard flag to before all other flags that CMake adds for
other abstractions, and before those added by `add_compile_options`.

`CMAKE_<LANG>_FLAGS` should still precede the language flags though,
because they are meant to be treated as language-wide modifications to
the compiler defaults, similar to `$CC $CFLAGS`.

Fixes: #23860
Fixes: #24170
2022-11-18 11:44:52 -05:00
Brad King
ad16ae5c70 VS: Recognize -std: flag in CMAKE_C_FLAGS in target with C++ sources
Extend commit b325484928 (VS: Fix C language standard in target with C++
sources, 2020-09-28, v3.19.0-rc1~74^2) to account for users placing a
`-std:` flag in `CMAKE_C_FLAGS`.
2022-11-18 11:16:50 -05:00
Brad King
4391808712 Merge topic 'file-COPY_FILE-retry'
d34986036f ExternalData: Improve robustness on Windows to copy a data object to a file
efa9eec040 file(COPY_FILE): Add option to retry on Windows if input access fails
fa518188d8 cmSystemTools: Remove unused CopySingleFile overload

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7934
2022-11-18 09:40:13 -05:00
Kyle Edwards
830eed374d CMake: fix sizeof string literal violations 2022-11-18 09:37:58 -05:00
Brad King
0784261a68 Merge topic 'clang-tidy-module-pragma-once-check'
91a7c0b51c CMake: fix violations of #pragma once check
aa0c99c55c clang-tidy module: add test for #pragma once check
c9af6f2ff6 clang-tidy module: add #pragma once check
68a4d97da7 clang-tidy module: allow header files in test cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !7933
2022-11-18 09:35:21 -05:00
Brad King
1cefd1da95 Merge topic 'ninja-swiftmodule-no-exe'
38c8807c5a Ninja: Avoid re-linking a Swift executable on every build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7901
2022-11-18 09:34:35 -05:00
Brad King
7be4574790 Merge topic 'refactor-cmDocumentation'
6e3e8827fa Refactor: `cmGlobalGeneratorFactory::GetDocumentation` returns entry
e99a4acbcd cmGlobalGeneratorFactory.h: Simplify returning default values
7daadd304f cmake.cxx: Simplify `cmake::AppendExtraGeneratorsDocumentation()`
df2047c2ac cpack.cxx: Optimize calls to `std::osteam::operator<<`
f6180485bb cpack.cxx: Eliminate redundant `if`
d7c183f35c cpack.cxx: Deduplicate "Generators" section creation code
9c06f0dd71 cmake.cxx: Move `static` functions to an anonymous namespace
69918b07e1 cmDocumentationEntry: Drop all user provided ctors for C++ >= 14
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7605
2022-11-18 09:28:46 -05:00
Brad King
e558beeef6 Merge topic 'build-local-interface-genex'
38cbf5e15b Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex
37b5c78688 cmGeneratorExpression: Refactor stripExportInterface() to use enum class

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7919
2022-11-18 09:27:35 -05:00
Brad King
1cc936f314 Merge topic 'genex-TARGET_PROPERTY-scope'
8437141b53 Genex: Fix TARGET_PROPERTY lookup scope in transitive usage requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !7928
2022-11-18 09:25:43 -05:00
Ben Boeckel
a02d792c6e cxxmodules: add properties to control scanning
The `CXX_SCAN_FOR_MODULES` property may be used to control scanning for
targets and for source files rather than assuming "C++20 always needs to
be scanned".
2022-11-18 07:54:31 -05:00
Kitware Robot
ee7479fb5a CMake Nightly Date Stamp 2022-11-18 00:01:09 -05:00
Ben Boeckel
008c09d6db cmNinjaTargetGenerator: factor out determining the fileset of a source
This information is now needed in more than one place, so factor the
logic out and use it to build a cache.
2022-11-17 15:26:55 -05:00
Brad King
efa9eec040 file(COPY_FILE): Add option to retry on Windows if input access fails
On Windows, a file may be inaccessible for a short time after it is
created.  This occurs for various reasons, including indexing, antivirus
tools, and NTFS's asynchronous semantics.  Add an `INPUT_MAY_BE_RECENT`
option to tell CMake that the input file may have been recently created
so that we can retry a few times to read it.
2022-11-17 15:05:07 -05:00
Kyle Edwards
91a7c0b51c CMake: fix violations of #pragma once check 2022-11-17 13:55:52 -05:00
Brad King
fa518188d8 cmSystemTools: Remove unused CopySingleFile overload 2022-11-17 13:27:19 -05:00
Evan Wilde
38c8807c5a Ninja: Avoid re-linking a Swift executable on every build
Swift doesn't emit swiftmodules for executables, so we shouldn't put it
in dependency graph.  Ninja sees the "missing" dependency and always
tries to rebuild/re-link the target.
2022-11-17 13:05:22 -05:00
Kyle Edwards
38cbf5e15b Genex: Add $<BUILD_LOCAL_INTERFACE:...> genex
Fixes: #23209
2022-11-17 09:31:27 -05:00
Kyle Edwards
37b5c78688 cmGeneratorExpression: Refactor stripExportInterface() to use enum class 2022-11-17 09:31:27 -05:00
Brad King
c5a945dce8 Merge topic 'vs-build-parallel'
48db261e69 cmake --build: Use both inter- and intra-project parallelism with msbuild

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7926
2022-11-17 08:15:54 -05:00
Brad King
14cf3b1039 Merge topic 'file-archive-zstd-compression-level'
ed519b1cba file(ARCHIVE_CREATE): Allow higher compression level for Zstd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7924
2022-11-17 08:15:04 -05:00
Brad King
8437141b53 Genex: Fix TARGET_PROPERTY lookup scope in transitive usage requirements
When `$<TARGET_PROPERTY:tgt,prop>` is used in an `INTERFACE_*` target
property for usage requirements, it may be evaluated in the context of a
dependent target in another directory.  Look up the `tgt` name in the
directory of the target whose property holds the expression so that
imported targets isolated to that directory are visible.

Fixes: #24163
2022-11-17 07:57:21 -05:00
Alex Turbov
6e3e8827fa Refactor: cmGlobalGeneratorFactory::GetDocumentation returns entry
Before, a documentation entry was in/out parameter.
Now it's a normal return value.

This also makes possible to eliminate defaulted default ctor
for `cmDocumentationEntry` for C++ 11.

Also, simplify `cmake::AppendGlobalGeneratorsDocumentation()`.
2022-11-17 16:37:13 +04:00
Alex Turbov
e99a4acbcd cmGlobalGeneratorFactory.h: Simplify returning default values 2022-11-17 16:37:13 +04:00
Alex Turbov
7daadd304f cmake.cxx: Simplify cmake::AppendExtraGeneratorsDocumentation() 2022-11-17 16:37:13 +04:00