Commit Graph

7131 Commits

Author SHA1 Message Date
Brad King
92cc1f3b62 Merge topic 'Ninja-use-depslog'
bb7a0497ef cmTransformDepfile: warn when a depfile is not written to
c22c473bde Tests/Ninja*/CustomCommandDepfile: check that deps are in the database
b0177003e1 cmGlobalNinjaGenerator: tell `ninja` to actually read the depfile
45eff9145e cmAddCustomCommandCommand: use `cmStrCat`
c6445c615b Tests/RunCMake/Ninja: fix subdir prefix check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8911
2023-11-07 09:07:46 -05:00
Brad King
530deed998 Merge topic 'cmake-E-cat-stdin'
ab72846794 cmake -E cat: Add ability to print standard input

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8942
2023-11-06 10:35:45 -05:00
權少
c5388bd320 CMakeFindPackageMode: Link to cmake --find-package documentation 2023-11-03 10:17:38 -04:00
Kyle Edwards
ab72846794 cmake -E cat: Add ability to print standard input 2023-11-03 09:03:25 -04:00
Brad King
0f02655bb0 Merge topic 'if-check-file-permissions'
337bc5662c if(): add operators IS_READABLE, IS_WRITABLE and IS_EXECUTABLE.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8908
2023-11-02 09:31:01 -04:00
Ben Boeckel
b0177003e1 cmGlobalNinjaGenerator: tell ninja to actually read the depfile
But only do so if the depfile is not specified as an output of the
command. Otherwise the command will out-of-date itself as `ninja`
deletes depfiles that it incorporates into the database and a missing
output will cause the command to run again.
2023-11-01 14:08:18 -04:00
Brad King
2e16fca2be Merge topic 'cxxmodules-cmp0155-graceful-fallback-without-scanner'
1f507580a1 cmGlobalGenerator: give context about module queries
889aa0354a CMP0155: ignore scanning for sources if no scanner is available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8925
2023-11-01 13:48:15 -04:00
Marc Chevrier
337bc5662c if(): add operators IS_READABLE, IS_WRITABLE and IS_EXECUTABLE.
Offers possibility to check for file or directory permissions.
2023-11-01 14:53:31 +01:00
Ben Boeckel
889aa0354a CMP0155: ignore scanning for sources if no scanner is available
This allows for a more graceful transition for projects using C++20
without scanner support (e.g., Clang 15 or GCC 13). While newer
compilers will (needlessly) scan, it allows C++20-using projects to use
older compilers without having to set `CMAKE_CXX_SCAN_FOR_MODULES` to
support newer CMake minimum versions.

Fixes: #25357
2023-11-01 09:52:08 -04:00
Ben Boeckel
59c2143920 Help/IMPORTED_LOCATION: link to LOCATION_<CONFIG> docs 2023-10-28 10:04:16 -04:00
Brad King
f55043f87e Merge topic 'unity-build-objc'
e218db1a90 Unity: Enable UNITY_BUILD for OBJC and OBJCXX files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8906
2023-10-27 09:06:44 -04:00
Rob Raguet-Schofield
e218db1a90 Unity: Enable UNITY_BUILD for OBJC and OBJCXX files 2023-10-26 10:01:41 -04:00
Marc Chevrier
c26c6ac488 Link Step: compute effective linker used by the compiler
Extract the effective linker during the computation of implicit artifacts
delivered by the compiler to the linker.
Define various variables describing the linker:
* CMAKE_<LANG>_COMPILER_LINKER
* CMAKE_<LANG>_COMPILER_LINKER_VERSION
* CMAKE_<LANG>_COMPILER_LINKER_ID
* CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT

This is complementary to feature introduced by commit 96a953b1ed
(Add options to specify linker tool, 2023-09-27).

Fixes: #17596, #18209, #25344
2023-10-24 08:34:50 -04:00
Brad King
e93ad8eecd Merge topic 'ninja-better-order-depends'
ed45432571 cmNinjaTargetGenerator: do not order-depend on C++ module sources
0973cd6702 cmNinjaTargetGenerator: use the file set visibility API
4625170925 cmFileSet: add a query for includeable file set types
51f9d9f0a2 cmNinjaTargetGenerator: avoid traversing old outputs repeatedly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8902
2023-10-23 09:39:23 -04:00
Brad King
34c51a385b Merge topic 'ninja-better-order-depends' into release-3.28
ed45432571 cmNinjaTargetGenerator: do not order-depend on C++ module sources
0973cd6702 cmNinjaTargetGenerator: use the file set visibility API
4625170925 cmFileSet: add a query for includeable file set types
51f9d9f0a2 cmNinjaTargetGenerator: avoid traversing old outputs repeatedly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8902
2023-10-23 09:39:22 -04:00
Brad King
45b41722d6 Merge topic 'doc-modules-deprecated'
75ca6e17f2 Help: Move some deprecated modules to the dedicated sections

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8903
2023-10-23 09:38:32 -04:00
權少
75ca6e17f2 Help: Move some deprecated modules to the dedicated sections 2023-10-20 09:01:33 -04:00
Brad King
35c7e237e7 Merge topic 'ci-linkcheck'
54e06c601d Help: Replace link with its http redirect

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8898
2023-10-20 08:43:04 -04:00
Ben Boeckel
ed45432571 cmNinjaTargetGenerator: do not order-depend on C++ module sources
C++ module sources should not be included by any other TUs, so their
presence cannot matter for order-only dependencies of the entire target.
Exclude them.

Update CMP0154 to take this into consideration and add tests to the
`CXXModules` suite (which already deals with module support detection).
2023-10-20 07:18:33 -04:00
Brad King
d705ca9d34 Merge topic 'doc-cmake-presets-8'
d3978a3835 Help: Document cmake-presets version 8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8899
2023-10-19 11:31:55 -04:00
Johel Ernesto Guerrero Peña
d3978a3835 Help: Document cmake-presets version 8
This was accidentally missed in commit f1a7179520 (presets: Add $schema
property to JSON schema, 2023-09-07, v3.28.0-rc1~106^2).
2023-10-19 09:53:48 -04:00
Brad King
54e06c601d Help: Replace link with its http redirect 2023-10-19 09:24:41 -04:00
Cristian Le
b37b912e8f CMAKE_PROJECT_INCLUDE: Allow to run module files
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-18 18:01:05 +02:00
Brad King
a3fbc255ff Merge topic 'project-include-multiple'
704acca96b CMAKE_PROJECT_INCLUDE: Add support for including multiple files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8884
2023-10-18 10:08:49 -04:00
Brad King
aff7870172 Merge topic 'cxxmodules-vs-no-synthetic-targets'
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:53 -04:00
Cristian Le
704acca96b CMAKE_PROJECT_INCLUDE: Add support for including multiple files
Fixes: #25341
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-18 13:39:55 +02: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
dd78592ba1 Merge topic 'try_compile-alias-targets'
8f9f371668 try_compile: Add support for using ALIAS targets
9f8aa94192 Add missing `OUTPUT` in ExportImport test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8877
2023-10-17 10:22:54 -04:00
Brad King
c672e51bd3 Merge topic 'try_compile-linker-language'
0f37000304 try_{compile,run}: add LINKER_LANGUAGE option
dc0dbffb0f Tests: Remove redundant policy setting from RunCMake.try_{compile,run} cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8871
2023-10-17 10:18:56 -04:00
Cristian Le
8f9f371668 try_compile: Add support for using ALIAS targets
Fixes: #25337
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-16 20:22:23 +02:00
scivision
0f37000304 try_{compile,run}: add LINKER_LANGUAGE option
Fixes: #25326
2023-10-16 11:30:17 -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
Brad King
b74d888531 Merge topic 'doc-typo'
5bbc9055c0 Help: Fix typo in COMPATIBLE_INTERFACE_NUMBER_MIN

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8867
2023-10-11 10:28:14 -04:00
權少
5bbc9055c0 Help: Fix typo in COMPATIBLE_INTERFACE_NUMBER_MIN 2023-10-11 10:15:11 -04:00
Brad King
728e41e7f7 Merge branch 'release-3.27' 2023-10-06 09:45:18 -04:00
Brad King
43b7af5666 Merge branch 'release-3.27' into release-3.28 2023-10-06 09:44:56 -04:00
Brad King
9532e1cf5b CMake 3.27.7 2023-10-06 09:08:35 -04:00
Brad King
debfb09e49 Begin post-3.28 development 2023-10-03 11:24:20 -04:00
Brad King
959a409c20 Help: Drop development topic notes to prepare release
Release versions do not have the development topic section of
the CMake Release Notes index page.
2023-10-03 11:21:24 -04:00
Brad King
5df79d1930 Help: Update Sphinx versionadded directives for 3.28 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.27.0 --overwrite

Manually remove directives added to new documentation of existing
environment variables.
2023-10-03 11:07:16 -04:00
Brad King
4eb2386901 Help: Organize and revise 3.28 release notes
Add section headers similar to the 3.27 release notes and move each
individual bullet into an appropriate section.  Revise a few bullets.
2023-10-03 11:07:16 -04:00
Brad King
32f3966521 Help: Consolidate 3.28 release notes
Run the `Utilities/Release/consolidate-relnotes.bash` script to move
notes from `Help/release/dev/*` into `Help/release/3.28.rst`.
2023-10-03 10:46:13 -04:00
Brad King
2c4f579124 Help: Fix versionadded indentation in cmake-generator-expressions(7) manual
Fix indentation of the `versionadded` markup added by commit 634079b86d
(cmGeneratorExpressionEvaluator: Short-circuit boolean operators,
2023-09-11) to render the note in the appropriate scope.
2023-10-03 10:46: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
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
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
Ben Boeckel
68caec9137 Help: add a manpage for cxxmodule support 2023-10-02 10:17:31 -04:00
Brad King
ad4bed1679 Merge topic 'doc-CMP0124'
55bf2a3494 Help: Document CMP0124 behavior on already-set variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8850
2023-10-02 09:00:02 -04:00
Brad King
196960043d Merge topic 'doc-CMP0124' into release-3.27
55bf2a3494 Help: Document CMP0124 behavior on already-set variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8850
2023-10-02 09:00:01 -04:00