Commit Graph

34487 Commits

Author SHA1 Message Date
Ben Boeckel 80d6544398 cxxmodules: generate synthetic targets as an initial pass
We need to be able to construct BMIs that will be usable from the client
modules for the target importing the module, so create BMI-only
compilation rules for `IMPORTED` targets to create these BMIs.
2023-08-17 14:42:53 -04:00
Ben Boeckel 3dc6676ecc cmSyntheticTargetCache: add a struct for synthetic target caching 2023-08-17 14:42:53 -04:00
Ben Boeckel cb356b540c cmCxxModuleUsageEffects: add a class to capture module usage effects
When importing a C++ module, there may be requirements imposed by the
importer so that the compiler can reliably read the BMI. For example,
the standard used in the importer may need to also apply to the imported
BMI.

Right now, there are no tracked requirements. As we learn more, this
class can start tracking more information.

See: https://wg21.link/p2581r2
2023-08-17 14:42:53 -04:00
Ben Boeckel c1defd9dd3 cmDyndepCollation: add initializers for POD types
This avoids invalid states from existing.
2023-08-17 14:42:53 -04:00
Ben Boeckel a53748e319 cmDyndepCollation: add a query for whether an object is BMI-only
The collator needs to know that the object *is* a BMI so that it can
just use the location directly.
2023-08-17 14:42:53 -04:00
Ben Boeckel 9840bfdab0 cmDyndepCollation: support BMI-only collation 2023-08-17 14:42:53 -04:00
Ben Boeckel caf5971c8a cmTarget: report that synthetic targets can compile sources 2023-08-17 14:42:53 -04:00
Ben Boeckel 3a8ea5c3a0 cmTarget: rename entry copying method
It will also be used to copy from other targets, not just directories.
2023-08-17 14:42:53 -04:00
Ben Boeckel 1ccf25b049 cmTarget: track and store IMPORTED_CXX_MODULES_ usage properties
While not "usage requirements" directly, when applied to a target that
will eventually have the BMI compile rules attached to them, they need
tracked as such.
2023-08-17 14:42:53 -04:00
Ben Boeckel 159585967a cmGeneratorTarget: classify BMI-only C++ module sources 2023-08-17 14:42:53 -04:00
Ben Boeckel 7b069510c5 cmImportedCxxModuleInfo: introduce code to parse exported BMI properties 2023-08-17 14:42:53 -04:00
Ben Boeckel 249cd3efad cmExportFileGenerator: export private compile info for C++ modules
When consuming exported targets which contain C++ modules, the consuming
project must be able to recompile BMI files using the original target's
flags. This is because a module source may use some private target usage
requirement but not want to propagate it to consumers. To facilitate
this, export the private information as necessary for consumers to be
able to perform the BMI compilations.
2023-08-17 14:42:53 -04:00
Ben Boeckel 1690e451f7 cmGeneratorTarget: support better errors when checking for C++20 modules
Some callers have their own error reporting mechanisms which give more
context. Support handing off the error string for these use cases.
2023-08-16 10:40:11 -04:00
Kyle Edwards 58d27dc6db Merge topic 'xcframework-check-platform-variant'
b4565c8c91 .xcframework: Check SupportedPlatformVariant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8713
2023-08-16 10:26:00 -04:00
Brad King c754f0d263 Merge topic 'remove_property'
822203dd65 Source: Rename SetProperty(nullptr_t) to RemoveProperty()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8721
2023-08-16 10:04:06 -04:00
Brad King 0386f0d098 Merge topic 'improve_rpath_removal_message'
c85fd9a705 file: Clarify CMake only drops RPATHS's it added

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8715
2023-08-16 10:01:34 -04:00
Brad King cdbb166fbd Merge topic 'unity_c_no_extensions'
7f7c443667 Unity: use C-style comments to work both with C and C++

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8718
2023-08-16 09:48:02 -04:00
Brad King b931fbd1b8 Merge topic 'ghs-escape-custom-command-comments'
5a41d926dd GHS: Escape custom command comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8714
2023-08-16 09:46:36 -04:00
Kitware Robot e70749e0d6 CMake Nightly Date Stamp 2023-08-16 00:01:15 -04:00
Robert Maynard c85fd9a705 file: Clarify CMake only drops RPATHS's it added 2023-08-15 14:59:14 -04:00
Vitaly Stakhovsky 822203dd65 Source: Rename SetProperty(nullptr_t) to RemoveProperty()
Avoid assignment to NULL semantics.
2023-08-15 12:13:56 -04:00
Sylvain Joubert 7f7c443667 Unity: use C-style comments to work both with C and C++
Update the comment added by commit 485256f2d0 (Unity: Suppress
clang-tidy 'bugprone-suspicious-include' warning, 2023-04-27,
v3.27.0-rc1~149^2) to work for C.

Fixes: #25184
2023-08-15 10:23:54 -04:00
William Sciaroni 5a41d926dd GHS: Escape custom command comments
Fixes: #25171
2023-08-15 09:53:41 -04:00
Kyle Edwards b4565c8c91 .xcframework: Check SupportedPlatformVariant 2023-08-15 09:45:17 -04:00
Kitware Robot 6ba173ba35 CMake Nightly Date Stamp 2023-08-15 00:01:14 -04:00
Kyle Edwards 2eab65ca82 Merge topic 'test-properties-directory'
2ccb897d86 get_test_property(): Add DIRECTORY option
84e76fedb0 get_property(TEST): Add DIRECTORY option
efc8f19cc5 set_tests_properties(): Add DIRECTORY option
753999d4db set_property(TEST): Add DIRECTORY option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8709
2023-08-14 11:18:54 -04:00
Kyle Edwards 0d95b68bd8 Merge topic 'ctest-generate-resource-spec-file'
c8c1dd0d95 CTest: Add ability to dynamically generate resource spec file
3f5a5a5856 cmCTestRunTest::StartFailure(): Add total argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8699
2023-08-14 11:18:03 -04:00
Kitware Robot 944fda58b2 CMake Nightly Date Stamp 2023-08-14 00:02:09 -04:00
Kitware Robot 70885ac769 CMake Nightly Date Stamp 2023-08-13 00:01:10 -04:00
Kitware Robot 96cea249a2 CMake Nightly Date Stamp 2023-08-12 00:01:12 -04:00
Kyle Edwards 2ccb897d86 get_test_property(): Add DIRECTORY option 2023-08-11 10:50:52 -04:00
Kyle Edwards 84e76fedb0 get_property(TEST): Add DIRECTORY option 2023-08-11 10:50:52 -04:00
Kyle Edwards efc8f19cc5 set_tests_properties(): Add DIRECTORY option 2023-08-11 10:50:52 -04:00
Kitware Robot 68b9f9037c CMake Nightly Date Stamp 2023-08-11 00:01:18 -04:00
Kyle Edwards 753999d4db set_property(TEST): Add DIRECTORY option 2023-08-10 17:36:14 -04:00
Kyle Edwards c8c1dd0d95 CTest: Add ability to dynamically generate resource spec file
Issue: #25106
2023-08-10 16:47:51 -04:00
Kyle Edwards 3f5a5a5856 cmCTestRunTest::StartFailure(): Add total argument
This function was being called when TotalNumberOfTests hadn't been
initialized, resulting in undefined output. It's not clear why this
was never apparent until now. Accept a total argument to ensure it's
initialized.
2023-08-10 16:46:25 -04:00
Brad King f3d9a82110 CMake 3.27.2 2023-08-10 11:30:44 -04:00
Brad King 661e005a0e Merge topic 'vs-sdk-selection'
d5118ed2e5 Merge branch 'backport-vs-sdk-selection' into vs-sdk-selection
89b611ab32 VS: Select latest Windows SDK even when targeting Windows 8.1 and below
ae97d82e83 VS: Teach CMAKE_GENERATOR_PLATFORM to support Windows 8.1 SDK selection
15ff89654b VS: Teach CMAKE_GENERATOR_PLATFORM to use Windows 10 SDKs for older versions
bba1a23da9 VS: Consolidate Windows SDK major version selection dispatch
209973e510 VS: Do not print empty Windows SDK version when none is selected
ec6dd77053 Tests: Remove redundant condition in RunCMake.GeneratorPlatform test
4776a584ad Help: Add 3.27 release note on VS default SDK selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8697
2023-08-10 11:27:48 -04:00
Brad King d5118ed2e5 Merge branch 'backport-vs-sdk-selection' into vs-sdk-selection 2023-08-10 10:00:53 -04:00
Brad King 89b611ab32 VS: Select latest Windows SDK even when targeting Windows 8.1 and below
The policy added by commit f90c8ab54e (VS: Select latest available
Windows SDK version by default, 2023-04-03, v3.27.0-rc1~206^2~1) applied
only when targeting Windows 10+.  Apply it to older versions too.

Fixes: #25170
Issue: #16202
2023-08-10 09:59:25 -04:00
Brad King ae97d82e83 VS: Teach CMAKE_GENERATOR_PLATFORM to support Windows 8.1 SDK selection
Honor an explicit `version=8.1` field value regardless of the Windows
target version.

Issue: #25170
2023-08-10 09:57:00 -04:00
Brad King 15ff89654b VS: Teach CMAKE_GENERATOR_PLATFORM to use Windows 10 SDKs for older versions
Honor an explicit `version=` field selecting a Windows 10 SDK regardless
of the Windows target version.

Issue: #25170
2023-08-10 09:34:50 -04:00
Brad King bba1a23da9 VS: Consolidate Windows SDK major version selection dispatch
Make logic choosing between Windows 10 SDKs and the Windows 8.1 SDK
easier to follow by consolidating it in the VS 14 generator.  The only
information we need from VS 15+ generators is whether the 8.1 SDK is
installed.
2023-08-10 09:33:20 -04:00
Brad King 209973e510 VS: Do not print empty Windows SDK version when none is selected 2023-08-10 09:33:19 -04:00
Brad King 1233da9f4a Merge topic 'OPTIMIZE_DEPENDENCIES-runtime-targets'
84eae7aeda OPTIMIZE_DEPENDENCIES: Skip order-only deps for non-linking targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8685
2023-08-10 08:58:34 -04:00
Brad King b47b44630b Merge topic 'cmSystemTools-hash-cleanup'
4980f47b46 cmGlobalGenerator: always support generating rule hashes
b334dc84c3 cmLocalGenerator: always support shortening filenames
36bd3d82f8 cmSystemTools: move `ComputeCertificateThumbprint` to the only consumer
a4e4daceaf cmSystemTools: remove `ComputeFileHash` method
0abde043d2 cmCryptoHash: prefer to cmSystemTools::ComputeFileHash
4d5198a986 cmSystemTools: remove `ComputeStringMD5` method
ec5f1c489a cmCryptoHash: prefer to cmSystemTools::ComputeStringMD5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8695
2023-08-10 08:57:16 -04:00
Kitware Robot e162bbc8cb CMake Nightly Date Stamp 2023-08-10 00:01:12 -04:00
Craig Scott 84eae7aeda OPTIMIZE_DEPENDENCIES: Skip order-only deps for non-linking targets
Fixes: #21517
2023-08-10 09:17:56 +10:00
Brad King 5ed03aa07a Merge topic 'add-cm-fileno'
fbdb1fd843 Source: Add cm_fileno wrapper

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8686
2023-08-09 11:36:07 -04:00