Commit Graph

34715 Commits

Author SHA1 Message Date
Brad King
fceeaff949 Merge topic 'linker-user-selection'
96a953b1ed Add options to specify linker tool

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8861
2023-10-16 10:39:51 -04:00
Brad King
5dce52e417 Merge topic 'revert-autogen-exe-per-config'
c074f5c81e Autogen: Revert "AUTO*_EXECUTABLE: add support for per-config values"
06a9b25b17 Tests: Revert "NinjaMultiConfig: Update tests for the new dependency change"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8878
2023-10-16 10:35:59 -04:00
Kitware Robot
4fd3397b6a CMake Nightly Date Stamp 2023-10-16 00:02:05 -04:00
Kitware Robot
734a009dcf CMake Nightly Date Stamp 2023-10-15 00:01:05 -04:00
Kitware Robot
0506d1d382 CMake Nightly Date Stamp 2023-10-14 00:01:19 -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
Marc Chevrier
96a953b1ed Add options to specify linker tool
Offer the capability, through variable `CMAKE_LINKER_TYPE`, as well as
the target property `LINKER_TYPE` to specify which linker must be used.

The implementation of this capability is specified by variables specific
to the language and linker type: `CMAKE_<LANG>_USING_LINKER_<TYPE>`.
Some definitions are provided as part of `CMake`.

For example, to select the `LLVM` linker rather than the standard one,
the type `LLD` should be specified through the variable `CMAKE_LINKER_TYPE`.
And, on `Apple`, `Linux` and some environments on `Windows`, the variable
`CMAKE_<LANG>_USING_LINKER_LLD` has value `-fuse-ld=lld`. And for `Windows`
environments  based on `MSVC`, where the linker is used directly, the tool
`lld-link.exe` will be used rather than `link.exe`.

Fixes: #19174, #24254, #24990
2023-10-13 11:52:35 +02:00
Kitware Robot
ee5f31ba72 CMake Nightly Date Stamp 2023-10-13 00:01:16 -04:00
Kitware Robot
bf5185ead7 CMake Nightly Date Stamp 2023-10-12 00:01:13 -04:00
Brad King
38643edc2d CMake 3.28.0-rc1 2023-10-11 14:33:33 -04:00
Brad King
b232269c4f Merge topic 'cxxmodules-try_compile'
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:06 -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
d27a41f29f Merge topic 'cxxmodules-diagnostics'
32438138c3 cxxmodules: Reference documentation in no-modules-support diagnostics
604466b83e Tests: Enforce RunCMake.CXXModules no-modules-support diagnostics strictly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8866
2023-10-11 10:29:59 -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
Kitware Robot
3123069e9a CMake Nightly Date Stamp 2023-10-11 00:01:14 -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
Kitware Robot
a93f5fbdec CMake Nightly Date Stamp 2023-10-10 00:01:09 -04:00
Kitware Robot
110b694017 CMake Nightly Date Stamp 2023-10-09 00:01:44 -04:00
Kitware Robot
b6890ed944 CMake Nightly Date Stamp 2023-10-08 00:01:12 -04:00
Kitware Robot
bc82d62b1b CMake Nightly Date Stamp 2023-10-07 00:01:14 -04:00
Brad King
06f8a60c93 Merge topic 'post-rel-dev'
be045c7c16 Configure CMake itself with policies through CMake 3.27
c5f1af1ffe export: Increase maximum policy version in exported files to 3.27
86d910ab73 Add deprecation warnings for policies CMP0126 and below

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8858
2023-10-06 08:42:02 -04:00
Brad King
afa8d8c60e Merge topic 'cxxmodules-explicit-c++20'
b8ead378de cxxmodules: Scan only targets that explicitly enable C++ 20
68fca3eafe cmGeneratorTarget: Track explicitly enabled language standard levels
da36e0638b cmGeneratorTarget: Remove outdated const/mutable pair
c1f1aedcee cmStandardLevelResolver: Add method to look up standard level by name
23b57462aa cmStandardLevelResolver: Report feature std level from GetNewRequiredStandard
7519001ae6 cmStandardLevelResolver: Add method to get feature standard level
99fa01d3fa cmStandardLevelResolver: Factor out public representation of level
fdd81a609a cmStandardLevelResolver: Clarify local variable name
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8860
2023-10-06 08:36:03 -04:00
Kitware Robot
84a4e294fc CMake Nightly Date Stamp 2023-10-06 00:01:17 -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
Kitware Robot
0d5a247dfa CMake Nightly Date Stamp 2023-10-05 00:01:15 -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
Kitware Robot
1b88c0b641 CMake Nightly Date Stamp 2023-10-04 00:01:22 -04:00
Brad King
be045c7c16 Configure CMake itself with policies through CMake 3.27 2023-10-03 17:21:47 -04:00
Brad King
c5f1af1ffe export: Increase maximum policy version in exported files to 3.27
The files generatd by `install(EXPORT)` and `export()` commands
are known to work with policies as of CMake 3.27, so enable them
in sufficiently new CMake versions.
2023-10-03 17:21:47 -04:00
Brad King
86d910ab73 Add deprecation warnings for policies CMP0126 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.21 and below to encourage projects to port
away from setting policies to OLD.
2023-10-03 17:21:47 -04:00
Brad King
89a065613d Merge topic 'cxxmodules-verify-c++20'
7ac696549a cxxmodules: Fix CMP0155 NEW behavior when C++ compile features are not known

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8857
2023-10-03 17:21:18 -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
debfb09e49 Begin post-3.28 development 2023-10-03 11:24:20 -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