Commit Graph

1143 Commits

Author SHA1 Message Date
Brad King
8832f78dd6 IWYU: Update for Debian 13 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 13.  Some patterns:

* Types named in virtual `override` signatures no longer require
  includes since the overridden signature already names them.

* A function argument's type needs to be included even if its constructor
  is called only by implicit conversion.  For example, constructing a
  `std::function` from a lambda now requires `<functional>`.

* Some prior mysterious `<type_traits>` inclusions are no longer required.
2025-11-12 14:54:35 -05:00
Eduard Voronkin
e42881422f FASTBuild: optimize try_compile builds
The generator does a lot of tricks in order to make the "rebuild-bff"
target up-to-date immediately after the generation. We can skip all of
those during "TryCompile" runs, which should reduce configure time.
2025-10-22 17:32:48 -07:00
Daniel Pfeifer
0696c9ac91 package_source: Remove redundant argument 2025-09-25 11:48:51 +02:00
Brad King
50f87b4bf2 cmGlobalGenerator: Simplify collection of targets under a project() 2025-09-16 11:32:27 -04:00
Ben Boeckel
9ad31a0d88 cmGlobalGenerator: mark intermediate directory strategy variables as used
Fixes: #27222
2025-09-12 13:59:22 -04:00
Brad King
54e7008e2d Merge topic 'vs-cleanup'
78d9564d50 cmGlobalVisualStudio7Generator: Inline short method at only call site
034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods
5004602715 cmGlobalVisualStudio7Generator: Factor folder collection out of write method
6ae4ed30d9 cmGlobalVisualStudio7Generator: Factor target collection out of write method
5582eb292e cmGlobalVisualStudio7Generator: Update outdated comment
2297ba9399 cmGlobalVisualStudio7Generator: Remove redundant C++ modules check
ccbd61dd53 cmGlobalVisualStudio7Generator: Remove unused member
93e34a5e0e cmGlobalGenerator: Constify GetTargetDirectDepends
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11130
2025-09-02 10:56:09 -04:00
Brad King
93e34a5e0e cmGlobalGenerator: Constify GetTargetDirectDepends
It should only be called for targets whose dependencies are already
computed.
2025-09-01 15:25:18 -04:00
Eduard Voronkin
01147454e7 FASTBuild: Add generator
Fixes: #15294
2025-08-26 14:29:01 -07:00
Eugene Zimichev
da330bcf88 macOS: Cache parsed xcframework plist content
Avoid repeating `plutil` calls on the same plist files.

Fixes: #27023
2025-08-15 10:15:54 -04:00
Daniel Pfeifer
ee1c32b6d7 source: Pass cmBuildOptions by value 2025-07-30 11:55:34 -04:00
Ben Boeckel
8180ecad9b autogen: support the SHORT intermediate dir strategy 2025-07-29 09:44:03 -04:00
John Parent
324907a60b cmGlobalGenerator: add methods for use when implementing short dir support 2025-07-29 08:06:28 -04:00
Ben Boeckel
02b2153d84 cmGlobalGenerator: add a query to represent support for short object names 2025-07-28 12:01:28 -04:00
Ben Boeckel
1d701491a2 pchreuse: always ask the PCH reuse target for PDB information
The property settings set things up once, but nothing ensures that
post-reuse hookup that any property changes propagate. Instead, when
computing PDB information, if PCH reuse is enabled, just always use its
values.

Also drop enforcement at generate time of property value consistency as
it is now ignored when PCH reuse is in effect.

Additionally, if a target is PCH-reused, generate a PDB output directory
for it.

The `PchReuseFromIgnoreOwnProps` test failed previously because the
post-reuse link update of the consuming `PDB` properties are no longer
considered. The `PchReuseFromUseUpdatedProps` failed because the
post-reuse link did not update the copy of the properties added to
consuming reuse target properties.
2025-07-22 12:42:57 -04:00
Ben Boeckel
c95a8348ce cmLocalGenerator: add an override for CMakeFiles-using paths
Visual Studio doesn't use a `CMakeFiles` subdirectory for its support
directories. However, some codepaths expect to use paths which are
always under `CMakeFiles`. Add a mechanism to keep the path for such
files.
2025-05-24 15:28:50 +02:00
Brad King
b05e5403d9 Experimental: Avoid mutating statically allocated data 2025-05-13 10:25:02 -04:00
Brad King
e78cf73b52 Merge topic 'makefile-progress'
5781cf406f Makefile: Fix progress with non-excluded targets in excluded dirs
89ab14b05b cmGlobalGenerator: Constify IsExcluded use of cmLocalGenerator
0aabf32590 cmGeneratorExpression: Constify use of cmLocalGenerator
88f54fba43 cmLocalGenerator: Avoid unnecessary const-ness propagation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10658
2025-04-17 10:00:51 -04:00
Brad King
89ab14b05b cmGlobalGenerator: Constify IsExcluded use of cmLocalGenerator 2025-04-15 10:44:32 -04:00
Marc Chevrier
2e9648e0de Ninja generator: restore correct encoding for policy CMP0181=OLD
Fixes: #26857
2025-04-12 16:37:57 +02:00
Brad King
c8f4ae9ccf Merge topic 'GNU-linker-pushpop_state-detection'
d5be7c7f31 Linker: Detect GNU push-state/pop-state flags more robustly
7b552b9a64 Linker: Save GNU push-/pop-state detection with compiler inspection results
a9b126b0da Linker: Save linker inspection results with compiler inspection results
3f5f2b2d49 Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10468
2025-03-21 08:07:16 -04:00
Brad King
8214004200 Merge topic 'GNU-linker-pushpop_state-detection' into release-4.0
d5be7c7f31 Linker: Detect GNU push-state/pop-state flags more robustly
7b552b9a64 Linker: Save GNU push-/pop-state detection with compiler inspection results
a9b126b0da Linker: Save linker inspection results with compiler inspection results
3f5f2b2d49 Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10468
2025-03-21 08:07:13 -04:00
Marc Chevrier
a9b126b0da Linker: Save linker inspection results with compiler inspection results
Reconfigure `CMake<LANG>Compiler.cmake` again after linker information
is detected.
2025-03-20 11:00:02 -04:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Alex Turbov
d34971f455 Refactor: Eliminate redundant std::to_string as arg of cmStrCat
Plus optimize some other string operations in the modified files.
2025-01-26 04:03:38 +04:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Kitware Robot
b2ba64add9 Revise C++ coding style using clang-format-18
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #26123
2025-01-23 11:43:06 -05:00
Brad King
10cfc8f538 Merge topic 'extern-domain'
e109307c43 Add support for foreign targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10171
2025-01-22 09:30:49 -05:00
Vito Gamberini
e109307c43 Add support for foreign targets 2025-01-21 15:26:40 -05:00
Brad King
05b2c563bb CMP0047: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
ed99370f63 CMP0043: Remove support for OLD behavior
Note that per-source `COMPILE_DEFINITIONS_<CONFIG>` are not covered by
the policy, and are still supported.
2025-01-19 09:41:02 -05:00
Brad King
9b148ed1ac CMP0042: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King
84f737545f CMP0037: Remove support for OLD behavior 2025-01-19 09:41:01 -05:00
Brad King
f8bc8780c1 CMP0026: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
796cf2d8eb CMP0025: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
65b45de1dd CMP0024: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
41a7a0119f CMP0018: Remove support for OLD behavior 2025-01-18 09:51:44 -05:00
Brad King
8018f2a6c4 Merge topic 'instrumentation'
097d4fd1b5 instrumentation: Collect and record project build system metrics
8a3c195188 Tests/RunCMake: Add RunCMake_CHECK_ONLY Option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !9791
2025-01-16 08:55:25 -05:00
Martin Duffy
097d4fd1b5 instrumentation: Collect and record project build system metrics
Add a feature for collecting build instrumentation for CMake projects.

Issue: #26099
2025-01-15 09:16:50 -05:00
Martin Duffy
ca5e6dadb5 install: Generate InstallScripts.json in consistent location
Since commit 159ba027b9 (Install: Add parallel installation option,
2024-06-19, v3.31.0-rc1~333^2) the file was generated relative to the
current working directory.  This is not always the top of the build
tree, so specify the path explicitly.
2025-01-13 12:04:42 -05:00
Martin Duffy
98a34a06e6 install: Generate InstallScripts.json in consistent location
Since commit 159ba027b9 (Install: Add parallel installation option,
2024-06-19, v3.31.0-rc1~333^2) the file was generated relative to the
current working directory.  This is not always the top of the build
tree, so specify the path explicitly.
2025-01-13 12:02:02 -05:00
Alex Turbov
bdece1c754 Refactor: Optimize ostream::operator<<() calls for some generators 2024-12-11 19:40:41 +04:00
Garrett Campbell
9ed178f9d8 Add generator-agnostic DEBUGGER_WORKING_DIRECTORY target property
Generalize the `VS_DEBUGGER_WORKING_DIRECTORY` property.

Issue: #16478
2024-12-09 10:47:10 -05:00
Martin Duffy
ea8e3107ec cmake --install: Respect CMAKE_DEFAULT_CONFIGS
When `cmake --install` is run with no `--config` passed, use
`CMAKE_DEFAULT_CONFIGS` to determine which config(s) to install.

Fixes: #21475
2024-11-19 11:37:47 -05:00
Brad King
659d8bd430 cmPolicies: Remove now-unused REQUIRED_IF_USED and REQUIRED_ALWAYS states 2024-11-13 11:43:07 -05:00
Marc Chevrier
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
Add a way to specify, in a portable way, to raise an error for any
warning during the link step. For that purpose, define:
* CMAKE_LINK_WARNING_AS_ERROR variable
* LINK_WARNING_AS_ERROR target property

Fixes: #25343
2024-11-12 15:11:53 +01:00
Marc Chevrier
656267c871 COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality
Methods renamed:
* SetIgnoreWasinigAsError => SetIgnoreCompileWasningAsError
* GetIgnoreWasinigAsError => GetIgnoreCompileWasningAsError
2024-11-12 14:52:28 +01:00
Martin Duffy
f50fb77a4f Ninja: Regenerate when test or install scripts are missing
Rerun CMake when `cmake_install.cmake` or `CTestTestfile.cmake` are out
of date.  This enables regeneration if a subdirectory is removed before
invoking `ninja`.

Fixes: #26396
2024-11-06 08:35:57 -05:00
Brad King
aebbbb2840 Merge topic 'linker-configuration-enhancements'
0619c064ff Linker configuration: enhance usability

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9937
2024-10-25 08:18:29 -04:00
Marc Chevrier
0619c064ff Linker configuration: enhance usability
The linker configuration file is now optional: It is loaded only if
variable CMAKE_<LANG>_USE_LINKER_CONFIGURATION is set to TRUE.

The file CMakeAddNewLanguage.txt is updated to take into account the
linker configuration.

Fixes: #26393
2024-10-24 16:37:30 +02:00