1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 04:01:40 +08:00

826 Commits

Author SHA1 Message Date
Ben Boeckel
dadaa28638 cmGeneratorTarget: synthetic targets don't have output either 2023-02-14 12:52:54 -05:00
Ben Boeckel
c97de1047f cmMakefile: add support for a "synthesized" target
It is a normal target, but will end up copying its internals from
another target. Keep track of this state so that such copying can only
occur when intended.
2023-02-14 12:33:58 -05:00
Ben Boeckel
5b58695321 cmTarget: store visibility as an enum rather than bools
C++ modules are going to introduce a third concept of "synthesized"
targets, so update logic where needed to avoid assuming "not imported?
must be normal".

Also add an accessor method to perform queries against the visibility.
2023-02-14 12:23:15 -05:00
Ben Boeckel
4b38d7d100 cmGeneratorTarget: INTERFACE targets with C++ modules are also "in"
`INTERFACE` targets with C++ modules are basically BMI-only modules. It
is unknown if they will be useful directly (due to ODR of the `module
M;` initializers needing to live in some specific object file). However,
they will be used to attach BMI-only compilations of `IMPORTED` C++
modules.
2023-02-08 13:00:45 -05:00
Ben Boeckel
d19648a928 cmGeneratorTarget: add a method to query if Fortran sources exist 2023-01-31 22:23:36 -05:00
Brad King
cd87bebe49 Merge topic 'optimize-full-name-function'
a525f5f1bf cmGeneratorTarget: Cache full name components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8033
2023-01-19 09:21:18 -05:00
Pierre Testart
a525f5f1bf cmGeneratorTarget: Cache full name components
Cache the result of cmGeneratorTarget::GetFullNameInternalComponents
to improve performance.
2023-01-18 09:12:17 -05:00
Vitaly Stakhovsky
b3edfcf46e cmValue: Use operator* explicitly to convert to std::string; avoid extra call 2023-01-15 23:39:02 -05:00
Marc Chevrier
74638c47ff STATIC_LIBRARY_OPTIONS: ensure correct expension of list inside a genex
Fixes: #24258
2022-12-20 12:20:48 +01:00
Brad King
3b4337adc7 Merge topic 'clang-tidy-export-fixes-dir'
232467eb1c clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7982
2022-12-07 08:19:53 -05:00
Kyle Edwards
232467eb1c clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property
Fixes: #21362
2022-12-06 10:39:29 -05:00
Brad King
5b1150e0e7 Merge topic 'link-options-cache'
7c63372c22 cmGeneratorTarget: Fix regression in CUDA device link options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7981
2022-12-05 12:55:50 -05:00
Brad King
7c63372c22 cmGeneratorTarget: Fix regression in CUDA device link options
Since commit f69d1872db (cmGeneratorTarget: Add caches to some
functions, 2022-11-23) we cache the computed link options for a target.
Cache the host and device link options separately.
2022-12-02 11:04:16 -05:00
Brad King
3b19541518 Merge topic 'add-generator-target-caches'
f69d1872db cmGeneratorTarget: Add caches to some functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7952
2022-11-30 07:28:12 -05:00
Pierre Testart
f69d1872db cmGeneratorTarget: Add caches to some functions
Add caches to the following cmGeneratorTarget functions in order to
improve performance:
- GetIncludeDirectories
- GetCompileOptions
- GetCompileDefinitions
- GetPrecompileHeaders
- GetLinkOptions
- GetLinkDirectories
2022-11-28 08:40:11 -08:00
Ben Boeckel
e37ff5694c cmGeneratorTarget: factor out fileset info and scanning detection 2022-11-23 18:52:36 -05:00
Ben Boeckel
9e61fc3d6d cmGeneratorTarget: factor out dyndep support detection 2022-11-23 17:35:41 -05:00
Kyle Edwards
830eed374d CMake: fix sizeof string literal violations 2022-11-18 09:37:58 -05:00
Kyle Edwards
09d7f947d6 cmGeneratorExpression: Require cmake instance 2022-11-11 12:29:41 -05:00
Brad King
7338a69881 Merge topic 'fix-cxx20-detection'
5e7c8f44ac Ninja: Restore support for compilers not defining a C++ standard level

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Jaeden Amero <kitware@patater.com>
Acked-by: Martin Kojtal <martin.kojtal@arm.com>
Merge-request: !7896
2022-11-11 08:19:51 -05:00
Lingkai Dong
5e7c8f44ac Ninja: Restore support for compilers not defining a C++ standard level
Since commit 386465bf83 (cmTarget: add support for C++ module fileset
types, 2022-04-08, v3.25.0-rc1~624^2~7), the Ninja generator checks for
C++20 support using logic that requires `CMAKE_<LANG>_STANDARD_DEFAULT`
to be non-empty.  On some compilers, such as ARMClang, CMake does not
automatically detect and set default language standards, thus causing
`HaveStandardAvailable` to raise an internal error.

To fix this issue, if `CMAKE_CXX_STANDARD_DEFAULT` is empty, assume all
standards to be supported instead of calling `HaveStandardAvailable`.
This is consistent with how `CompileFeaturesNode::Evaluate` handles this
case.

Fixes: #24146
2022-11-10 11:01:40 -05:00
ζeh Matt
eef13a4b33 VS: Add COMMON_LANGUAGE_RUNTIME support for "netcore"
Generate `CLRSupport` for Visual Studio projects.

Fixes: #22054
2022-10-28 11:55:58 -04:00
Kyle Edwards
b4e8ddbc2f clang-tidy: enable cmStrLen() check and fix violations 2022-10-19 14:51:21 -04:00
Daniel Hannon
6942234bf5 VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma: associated to verification file 2022-10-07 19:00:28 +01:00
Brad King
dc5fc898f6 Xcode: Set object file locations using TARGET_TEMP_DIR
This avoids relying on `SYMROOT` to locate the object files.

Issue: #22550
2022-09-29 15:04:07 -04:00
Brad King
06404a1979 Merge topic 'check-library-properties-fix-performances-regression'
985b4c82a6 Check link libraries properties: fix performances regression
a47eef32a3 renames method FinalizeTargetCompileInfo() in FinalizeTargetConfiguration().

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7651
2022-09-09 09:48:56 -04:00
Marc Chevrier
a47eef32a3 renames method FinalizeTargetCompileInfo() in FinalizeTargetConfiguration(). 2022-09-07 14:23:21 +02:00
Kyle Edwards
2ef64745c8 Merge topic 'file-set-source-group'
970052fedd FILE_SET: Fix source group detection
bcc3965813 Tests: Fix VS10Project SourceGroupTreeCMakeLists check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7609
2022-08-25 09:14:21 -04:00
Kyle Edwards
970052fedd FILE_SET: Fix source group detection
Call MatchChildrenFiles() instead of MatchesFiles() in order to
account for files being in subgroups of source groups.

Fixes: #23880
2022-08-24 16:07:24 -04:00
Kyle Edwards
e7bfd0ac7a Merge topic 'all-verify-interface-header-sets'
83e44002ae VERIFY_INTERFACE_HEADER_SETS: Add verification target for all

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7536
2022-08-03 09:58:43 -04:00
Brad King
f6917a2f1f Merge topic 'cuda_add_lto_support'
96bc59b1ca CUDA: Add Device LTO support for nvcc
1527d48cd0 CheckIPO: Refactor logic selecting test source files
4a552ab4ad remove unused variables
6eda92d037 remove unused variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7389
2022-08-03 09:42:17 -04:00
Kyle Edwards
83e44002ae VERIFY_INTERFACE_HEADER_SETS: Add verification target for all
Fixes: #23802
2022-08-03 08:19:08 -04:00
Brad King
b6ffca53f8 Merge topic 'verify-interface-header-sets-interface-library-source-language'
41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7517
2022-07-28 08:12:10 -04:00
Brad King
12830cc2a9 Merge topic 'verify-interface-header-sets-interface-library-source-language' into release-3.24
41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7517
2022-07-28 08:12:09 -04:00
Brad King
d9cca8e83d Merge topic 'verify-interface-header-sets-add-compile-definitions'
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7516
2022-07-28 08:11:19 -04:00
Kyle Edwards
41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages
If a target doesn't have any source files, fall back to the global
list of enabled languages to determine the language of the header
file to verify.

Fixes: #23774
2022-07-27 13:29:09 -04:00
Kyle Edwards
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
Fixes: #23732
2022-07-27 12:25:15 -04:00
Robert Maynard
96bc59b1ca CUDA: Add Device LTO support for nvcc
Fixes #22200
2022-07-22 10:34:45 -04:00
Brad King
d94e09ec88 Merge topic 'cpp-named-module-file-sets'
07bc3b07ec gitlab-ci: test C++ modules using GCC
1b2270aa4e ci: add a Docker image to test out C++ modules with GCC
8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
4151547e2f cmGlobalNinjaGenerator: use `cmModuleMapper` implementation
b43bdaff3c cmCxxModuleMapper: implement support for GCC's module map format
02d0f0e752 cmCxxModuleMapper: add source to handle module mapper contents
a046a45aad cmGlobalNinjaGenerator: add a TODO for header units
386465bf83 cmTarget: add support for C++ module fileset types
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7369
2022-06-17 11:35:12 -04:00
Ben Boeckel
386465bf83 cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake:

  - `CXX_MODULES`: interface modules (those using `export module M;`,
    `export module M:part;`, or `module M:internal_part;`)
  - `CXX_MODULE_HEADER_UNITS`: importable header units

Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
2022-06-16 10:28:34 -04:00
Da Quexian
69beee5314 Add SYSTEM target property
If it is ON, treat INTERFACE_INCLUDE_DIRECTORIES as system include directories.

Issue: #18040

Signed-off-by: Da Quexian <daquexian566@gmail.com>
2022-06-16 00:25:27 +08:00
FeRD (Frank Dana)
98a10290a8 cmSystemTools: Fix 'ErrorOccurred' spelling
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.

Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
2022-06-13 09:05:24 -04:00
Kyle Edwards
aadaac7f6d VERIFY_INTERFACE_HEADER_SETS: Add property for list of header sets
Add a new property, INTERFACE_HEADER_SETS_TO_VERIFY, which contains
a list of header sets that should be verified by
VERIFY_INTERFACE_HEADER_SETS.

Fixes: #23522
2022-05-25 14:37:27 -04:00
Ben Boeckel
a5f8cbe8b1 clang-tidy: address modernize-use-default-member-init lints 2022-05-24 09:09:43 -04:00
Kyle Edwards
259c265112 VERIFY_HEADER_SETS: Rename to VERIFY_INTERFACE_HEADER_SETS
Issue: #23448
2022-05-18 10:18:40 -04:00
Brad King
1cf59d5267 Merge topic 'file-set-generated-dependency'
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Gabriel Nützi <gnuetzi@gmail.com>
Merge-request: !7173
2022-04-15 08:23:57 -04:00
Kyle Edwards
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem
If an INTERFACE library has HEADER_SETS, and its header sets contain
files generated by a custom command, the library needs to participate in
the buildsystem so that the files will be generated.

Fixes: #23422
2022-04-14 09:17:54 -04:00
Kyle Edwards
c798744f81 FILE_SET: Add VERIFY_HEADER_SETS target property
Fixes: #23338
2022-03-29 13:58:27 -04:00
Brad King
cf312a2e54 LINK_LIBRARIES: Add support for LINK_ONLY genex
Previously we always used content guarded by `$<LINK_ONLY:...>`
in `LINK_LIBRARIES`, even when evaluating for non-linking usage
requirements.  Add a policy to honor `LINK_ONLY` in `LINK_LIBRARIES`
the same way we already do in `INTERFACE_LINK_LIBRARIES`.
2022-03-24 08:23:55 -04:00
Brad King
41a6b4a53b INTERFACE_LINK_LIBRARIES_DIRECT: Honor link dependencies through LINK_ONLY
In commit f3ad061858 (Add usage requirements to update direct link
dependencies, 2022-01-12, v3.23.0-rc1~44^2), we evaluated the transitive
closure of `INTERFACE_LINK_LIBRARIES` as a non-linking usage requirement.
That left out `INTERFACE_LINK_LIBRARIES_DIRECT` link dependencies that
appear behind private dependencies of a static library, guarded by the
`$<LINK_ONLY:...>` generator expression.  At the time, that decision was
intentional, in order to prevent arbitrary usage requirements from
leaking out of `PRIVATE` dependencies.

Since then, we've revised evaluation of `LINK_LIBRARIES` to distinguish
between collecting link dependencies and other usage requirements.  Use
that information when following `INTERFACE_LINK_LIBRARIES` to collect
the matching kind of requirements from `INTERFACE_LINK_LIBRARIES_DIRECT`.

Fixes: #22496
2022-03-22 11:57:48 -04:00