Commit Graph

34696 Commits

Author SHA1 Message Date
Brad King
dc7bed55e6 Merge topic 'cxxmodules-vs-no-synthetic-targets' into release-3.28
17fd7fe2ae Tests/CXXModules: test Visual Studio synthetic target error
badb6ab120 VS: Explicitly disallow C++ modules provided by imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8895
2023-10-18 09:51:52 -04:00
Ben Boeckel
badb6ab120 VS: Explicitly disallow C++ modules provided by imported targets
The `-ifcOnly` flag is understood by MSBuild, but there are unresolved
questions about how to integrate with with CMake's model.

See: #25328
2023-10-17 14:46:57 -04:00
Brad King
84ac583bc6 Merge topic 'cxxmodules-export-fileset-info' into release-3.28
0f36156740 cxxmodules: include `INCLUDES DESTINATION` directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8886
2023-10-17 09:50:06 -04:00
Brad King
ec916350db Merge topic 'execute_process-output_file-directory' into release-3.28
35f031e3b2 execute_process(): Restore opening files relative to WORKING_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8883
2023-10-17 09:41:38 -04:00
Ben Boeckel
0f36156740 cxxmodules: include INCLUDES DESTINATION directories
These paths are added outside the normal property management mechanisms.
Shuttle the value to the C++ module export as needed.

Fixes: #25289
2023-10-16 13:57:54 -04:00
Kyle Edwards
35f031e3b2 execute_process(): Restore opening files relative to WORKING_DIRECTORY
Prior to 5420639a, execute_process() would open INPUT_FILE, OUTPUT_FILE,
and ERROR_FILE relative to the WORKING_DIRECTORY argument if it was
provided. Restore this behavior for backwards compatibility.

Fixes: #25338
2023-10-16 12:23:41 -04:00
Orkun Tokdemir
c074f5c81e Autogen: Revert "AUTO*_EXECUTABLE: add support for per-config values"
Changing the `timestamp` file to `timestamp_$<CONFIG>` causes some user
projects to break when using Qt versions older than 6.6.

Revert commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for
per-config values, 2023-06-14, v3.28.0-rc1~96^2~1) pending further
investigation.

Issue: #20074
2023-10-13 14:16:26 -04:00
Brad King
38643edc2d CMake 3.28.0-rc1 2023-10-11 14:33:33 -04:00
Brad King
581a03a138 Merge topic 'cxxmodules-try_compile' into release-3.28
fd81024e80 cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8865
2023-10-11 10:31:05 -04:00
Brad King
32438138c3 cxxmodules: Reference documentation in no-modules-support diagnostics
Help users avoid errors about module support when they may not need it.

While at it, polish sentence syntax in the diagnostic messages.
2023-10-11 09:52:41 -04:00
Brad King
fd81024e80 cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compile
Under CMP0155's NEW behavior, projects that explicitly enable C++20
support with `set(CMAKE_CXX_STANDARD 20)` may also explicitly
disable scanning with `set(CMAKE_CXX_SCAN_FOR_MODULES OFF)`.
We already propagate `CMAKE_CXX_STANDARD` into `try_compile` test
projects, so propagate `CMAKE_CXX_SCAN_FOR_MODULES` too.

Fixes: #25313
2023-10-10 11:25:21 -04:00
Brad King
b8ead378de cxxmodules: Scan only targets that explicitly enable C++ 20
Previously we scanned any targets for which C++ 20 is enabled,
even if enabled only by the compiler's default, such as when
`CXXFLAGS=-std=c++20`.
2023-10-05 13:17:00 -04:00
Brad King
68fca3eafe cmGeneratorTarget: Track explicitly enabled language standard levels
Previously we only tracked when an explicit setting requires the
standard level to be higher than the compiler's default.
2023-10-05 13:16:24 -04:00
Brad King
da36e0638b cmGeneratorTarget: Remove outdated const/mutable pair 2023-10-04 18:45:30 -04:00
Brad King
c1f1aedcee cmStandardLevelResolver: Add method to look up standard level by name 2023-10-04 18:44:44 -04:00
Brad King
23b57462aa cmStandardLevelResolver: Report feature std level from GetNewRequiredStandard
Regardless of whether the feature requires a new (higher) standard
level, always report the standard level that the feature needs.
2023-10-04 18:44:18 -04:00
Brad King
7519001ae6 cmStandardLevelResolver: Add method to get feature standard level 2023-10-04 18:15:04 -04:00
Brad King
99fa01d3fa cmStandardLevelResolver: Factor out public representation of level 2023-10-04 17:14:58 -04:00
Brad King
fdd81a609a cmStandardLevelResolver: Clarify local variable name 2023-10-04 17:14:58 -04:00
Brad King
73a1d422a5 cmStandardLevelResolver: Mark builtin language standards table as const 2023-10-04 17:14:58 -04:00
Brad King
7ac696549a cxxmodules: Fix CMP0155 NEW behavior when C++ compile features are not known
With CMP0155 NEW behavior, we scan C++ sources in targets using C++ 20,
i.e., in which the `cxx_std_20` feature is available.  However, our
check for C++ feature availability may incorrectly succeed in two cases:

* MSVC versions from VS 2013 do not model C++ standard levels,
  so we assume all features are available as a heuristic to let
  projects at least try compiling with them.

* During ABI detection the `CMAKE_CXX20_COMPILE_FEATURES` variable is not
  populated so we assume all features are available, knowing that our
  ABI detection project does not need them.

For purposes of detecting targets using C++ 20, we do not want to assume
`cxx_std_20` is available, so verify that we really know it is.
2023-10-03 16:06:46 -04:00
Brad King
8bd2c8d1fd Begin 3.28 release versioning 2023-10-03 11:22:54 -04:00
Brad King
cbc0fd68a5 Merge topic 'cmDebugTools-add-header'
b0612796b1 cmDebugTools: add header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8849
2023-10-03 09:28:51 -04:00
Kitware Robot
94c90cb855 CMake Nightly Date Stamp 2023-10-03 00:01:13 -04:00
Brad King
8735cbba5d Merge topic 'cxxmodules-no-longer-experimental'
437280b127 cxxmodules: scan C++ sources for imports by default
3cddd11649 Ninja: message about not compiled sources explicitly
068fde1c34 cmGeneratorTarget: use `this->` for method calls
197a6bf171 cxxmodules: rework control logic for scanning regular C++ sources
5eb7bd641a Tests/RunCMake/CXXModules: remove rules file requirement
ff18acc301 CXXModules: remove `EXPERIMENTAL` from C++ module variable names
0c07f39006 cmExperimental: remove the flag for C++ modules
68caec9137 Help: add a manpage for cxxmodule support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !8828
2023-10-02 11:55:38 -04:00
Ben Boeckel
437280b127 cxxmodules: scan C++ sources for imports by default
Existing projects are not using C++ modules in their sources,
so introduce policy CMP0155 to enable scanning by default.
2023-10-02 10:17:31 -04:00
Ben Boeckel
3cddd11649 Ninja: message about not compiled sources explicitly
With CMP0155, filesets with only non-compiled sources do not go through
the collation path that detects it. Detect it explicitly like the Visual
Studio generator does.
2023-10-02 10:17:31 -04:00
Ben Boeckel
068fde1c34 cmGeneratorTarget: use this-> for method calls 2023-10-02 10:17:31 -04:00
Ben Boeckel
197a6bf171 cxxmodules: rework control logic for scanning regular C++ sources
Now that scanning support is no longer experimental, the logic for
whether or not to scan C++ 20 sources is now important because all
projects are now exposted to the logic. Make the scanning rules explicit
in the documentation and rework the queries to localize all of the
associated logic.

A policy to handle the ultimate fallback logic will be implemented in a
following commit.
2023-10-02 10:17:31 -04:00
Ben Boeckel
ff18acc301 CXXModules: remove EXPERIMENTAL from C++ module variable names 2023-10-02 10:17:31 -04:00
Ben Boeckel
0c07f39006 cmExperimental: remove the flag for C++ modules
All the major compilers now have scheduled releases with support for
scanning, so remove the experimental gate.

Fixes: #18355
2023-10-02 10:17:31 -04:00
Brad King
37c80628ba Merge topic 'ctest-timeout-flag'
d267c128a2 ctest: Restore support for --timeout values higher than default test timeout
dd779a4bc2 Tests: Clarify RunCMake.CTestTimeout case name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8851
2023-10-02 08:57:36 -04:00
Kitware Robot
393d94094e CMake Nightly Date Stamp 2023-10-02 00:02:02 -04:00
Ben Boeckel
b0612796b1 cmDebugTools: add header
This provides a utility macro which prints out:

- location of the call;
- the expression being evaluated; and
- the value of the expression.

Evaluates to the value of the expression.

Inspired by Rust's `dbg!` macro.

See: https://doc.rust-lang.org/stable/std/macro.dbg.html
2023-10-01 06:52:44 -04:00
Kitware Robot
6b645297b9 CMake Nightly Date Stamp 2023-10-01 00:01:11 -04:00
Kitware Robot
f822df37fd CMake Nightly Date Stamp 2023-09-30 00:01:11 -04:00
Brad King
b3205afcde Merge topic 'help-arbitrary'
4e50320978 Help: Allow help for arbitrary keywords

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8674
2023-09-29 09:36:24 -04:00
Brad King
d267c128a2 ctest: Restore support for --timeout values higher than default test timeout
Since refactoring in commit 0a5aeaf302 (cmCTestRunTest: Consolidate test
timeout selection logic, 2023-05-04, v3.27.0-rc1~120^2) we accidentally
truncate `--timeout` values to ctest's default `TimeOut`.  Fix the
logic to prefer the flag whenever the `TIMEOUT` property is not set.

In combination with the prior refactoring, this also fixes a bug that
caused `--timeout` values of 10000000 seconds or more to be ignored.

Fixes: #23979
2023-09-29 09:25:01 -04:00
Kitware Robot
e74c885aaa CMake Nightly Date Stamp 2023-09-29 00:01:21 -04:00
Kitware Robot
3ab5f3ccf1 CMake Nightly Date Stamp 2023-09-28 00:01:18 -04:00
Martin Duffy
4e50320978 Help: Allow help for arbitrary keywords
Changes `cmake --help [arg]` to search `Help/*/` instead of `Help/command/`
Allows editors to easily display manual for `<cword>`
2023-09-27 18:01:12 -04:00
Brad King
6bb05172ac Merge topic 'cxxmodules-export-dirs-with-prefix'
42654cc818 Tests/CXXModules: add tests for modules with include requirements
7217cb78cf Tests/CXXModules: relax line number matching in stderr
b3d1bbbbcc cmExportFileGenerator: relocate include directories for C++ modules
349ff8b080 cmGeneratorTarget: remove not-INTERFACE assertion
681a763425 cmGeneratorTarget: use a character literal

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8838
2023-09-27 11:25:22 -04:00
Brad King
2a12a83037 Merge topic 'misc-cxxmodule-fixes'
3b632f32fa Tests/CXXModules: forward the default build type
5ab6b09691 Tests/CXXModules: fix multi-config and MSVC details
11b62ef118 Tests/CXXModules: add missing `bmi-only` and compiler id fields
5d9631fbdd Tests/CXXModules: fix key set mismatch error messages
86e7fb72cb Tests/CXXModules: use a less generic name for the config
6b940dc590 Tests/CXXModules: replace the object extension as well
1c9f83c8ec Tests/CXXModules: fix error detection propagation
7a4c02cb38 cmGlobalGenerator: factor out messaging for CMP0037
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !8834
2023-09-27 11:22:05 -04:00
Brad King
81d863b60a Merge topic 'autogen-timestamp-per-config'
bac468ddfd AutoGen: Fix regression in timestamps on multi-config generators
c3f0825d3c Tests/RunCMake/Autogen: Factor out test setup
9654835b4f Tests/RunCMake/Autogen: Add expect_n_times() function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8840
2023-09-27 11:21:07 -04:00
Kitware Robot
a314fbe4b2 CMake Nightly Date Stamp 2023-09-27 00:01:18 -04:00
Ben Boeckel
b3d1bbbbcc cmExportFileGenerator: relocate include directories for C++ modules
Include directories are paths that need munged on install to support the
installation prefix.

Fixes: #25275
2023-09-26 14:32:46 -04:00
Ben Boeckel
349ff8b080 cmGeneratorTarget: remove not-INTERFACE assertion
IMPORTED INTERFACE targets which provide C++ modules may have include
directories that need checked for whether they are system directories or
not. These directories are intended for the module compilation
themselves (which may include headers that module consumers do not need).
2023-09-26 14:31:42 -04:00
Orkun Tokdemir
bac468ddfd AutoGen: Fix regression in timestamps on multi-config generators
Since commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for
per-config values, 2023-06-14) we do not correctly generate outputs
for one configuration after another configuration has been built.
Fix this:

- Revert some config based stuff for `Xcode` due to the `$<CONFIG>`
  genex usage limitation in source files with `Xcode`.
- For multi-config generators use a per-config `timestamp_$<CONFIG>`
  file instead of one `timestamp` file.

Fixes: #25261
2023-09-26 11:54:26 -04:00
Brad King
5a79ea2799 Merge topic 'cuda_handle_target_objects_in_device_link'
cd984261e1 CUDA: Device linking now uses TARGET_OBJECTS content
aa8facefe8 CUDA: Visual Studio propagate objects to device linking

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8829
2023-09-26 09:42:42 -04:00
Brad King
5d32320bf3 Merge topic 'hip-nvidia'
fd982eec10 HIP: Add tests for special NVIDIA values of CMAKE_HIP_ARCHITECTURES
8c8b3f1bfa HIP: Fix support for -DCMAKE_HIP_ARCHITECTURES=native with NVCC
b3e92775ab HIP: Add CMAKE_HIP_HOST_COMPILER when compiler is NVCC
e43918b4ca HIP: Fix linking mixed-lang binary with CXX compiler and Makefile generators
4794505122 HIP: Do not require hip-lang package for NVIDIA platform
09d759dc7f HIP: Simplify exclusion of AMD device runtime with NVIDIA GPUs
2a60663670 HIP: Simplify CMAKE_GENERATOR references for determining compiler
8124950f6c CUDA: Generalize CMAKE_{CUDA => <LANG>}_HOST_COMPILER variable docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8836
2023-09-26 09:40:25 -04:00