Commit Graph

36494 Commits

Author SHA1 Message Date
Brad King 03e7b8cb07 Merge topic 'simplify-removed-policies'
ff9bc7291a cmPolicies: Remove now-unused GetRequiredPolicyError method
659d8bd430 cmPolicies: Remove now-unused REQUIRED_IF_USED and REQUIRED_ALWAYS states
58a90857f0 cmPolicies: Simplify representation of removed policies
dade821948 cmPolicies: Reduce boilerplate in policy table entries
453916dfae cmPolicies: Add missing license notice
9a28b0654f cmGeneratorExpressionNode: Clarify constant in unreachable code path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !9993
2024-11-14 09:41:21 -05:00
Brad King 51309a05fa Merge topic 'ctest-update-refactoring'
9c23f8ed26 cmCTestUpdateCommand: Remove handler usage
255b1af5af cmCTestUpdateHandler: Move class into cmCTestUpdateCommand.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9980
2024-11-14 09:04:04 -05:00
Kitware Robot 02d855d749 CMake Nightly Date Stamp 2024-11-14 00:01:24 -05:00
Brad King ff9bc7291a cmPolicies: Remove now-unused GetRequiredPolicyError method 2024-11-13 11:47:10 -05:00
Brad King 659d8bd430 cmPolicies: Remove now-unused REQUIRED_IF_USED and REQUIRED_ALWAYS states 2024-11-13 11:43:07 -05:00
Brad King 58a90857f0 cmPolicies: Simplify representation of removed policies
A policy that can be set defaults to `WARN` internally.
A policy that has been removed always uses `NEW`.
The `REQUIRED_IF_USED` and `REQUIRED_ALWAYS` states
are not needed.
2024-11-13 11:33:29 -05:00
Brad King dade821948 cmPolicies: Reduce boilerplate in policy table entries
Remove unnecessary `cmPolicies::` prefix from table entries. It can be
written where the entries are expanded.  This also prevents IWYU from
complaining that the table is written before `cmPolicies::PolicyStatus`
is declared.
2024-11-13 11:27:44 -05:00
Brad King 453916dfae cmPolicies: Add missing license notice 2024-11-13 11:23:19 -05:00
Brad King 9a28b0654f cmGeneratorExpressionNode: Clarify constant in unreachable code path 2024-11-13 09:38:24 -05:00
Brad King 1e0cd39460 Merge topic 'link-warning-as-error'
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
656267c871 COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9984
2024-11-13 09:24:36 -05:00
Daniel Pfeifer 9c23f8ed26 cmCTestUpdateCommand: Remove handler usage 2024-11-13 10:54:57 +01:00
Daniel Pfeifer 255b1af5af cmCTestUpdateHandler: Move class into cmCTestUpdateCommand.cxx
Place declaration and definitions into places where following
refactoring will cause minimal deltas.
2024-11-13 10:39:44 +01:00
Kitware Robot 894ac85d6b CMake Nightly Date Stamp 2024-11-13 00:01:40 -05:00
Brad King c5840e2ebc Merge topic 'cmake-self-symlinks'
0994bc7929 cmake: Preserve symlinks in references to itself when possible
0925abb09b cmSystemTools: Invert condition to make non-bootstrap logic easier to follow
46ac308249 cmSystemTools: Factor out helpers from FindCMakeResources
b91ec8c48f cmSystemTools: Clarify decision to look for resources from the build tree
cbee4eed0f cmSystemTools: Re-order resource and tool finding logic
f6acf1f7b7 cmSystemTools: Reduce rightward drift in success path on UNIX
962e4479d4 cmSystemTools: Clarify app bundle layout on macOS
56632ddaa3 cmSystemTools: Remove redundant filesystem access on Windows
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Carlo Cabrera <carlo.antonio.cabrera@gmail.com>
Merge-request: !9987
2024-11-12 10:17:56 -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
Kitware Robot 3c9b8b4a7c CMake Nightly Date Stamp 2024-11-12 00:01:46 -05:00
Brad King 0994bc7929 cmake: Preserve symlinks in references to itself when possible
CMake's tools search relative to their own locations to find their
resources.  Previously they always started at their own `realpath()`.
The intention was to support invocation through symbolic links to the
binaries where the resources can only be found under the real prefix:

    /logical/prefix/bin/cmake   -> /real/prefix/bin/cmake
                                   /real/prefix/share/cmake

The generated build system refers to CMake's own tools and resources
through the `/real/prefix`.  This is not desirable in the case that the
`/logical/prefix` is meant as the canonical location and uses symbolic
links for both tools and resources as an implementation detail:

    /logical/prefix/bin/cmake   -> /real/prefix/bin/cmake
    /logical/prefix/share/cmake -> /real/prefix/share/cmake

In this case, the generated build system should refer to CMake's own
tools and resources through the `/logical/prefix`.  This way the
`/real/prefix` can be changed, and the symbolic links updated,
without breaking already-generated build systems.

Fixes: #19849
Fixes: #21059
Inspired-by: Carlo Cabrera <github@carlo.cab>
Inspired-by: Rodger Combs <rodger.combs@gmail.com>
2024-11-11 11:53:59 -05:00
Brad King 0925abb09b cmSystemTools: Invert condition to make non-bootstrap logic easier to follow 2024-11-11 11:53:00 -05:00
Brad King 46ac308249 cmSystemTools: Factor out helpers from FindCMakeResources
Factor out helpers to:

- Find our own executable
- Find resources in the install tree or the build tree
2024-11-11 11:49:43 -05:00
Brad King b91ec8c48f cmSystemTools: Clarify decision to look for resources from the build tree 2024-11-11 11:49:43 -05:00
Brad King cbee4eed0f cmSystemTools: Re-order resource and tool finding logic
Consolidate `CMAKE_BOOTSTRAP` conditions.
2024-11-11 11:49:05 -05:00
Brad King f6acf1f7b7 cmSystemTools: Reduce rightward drift in success path on UNIX 2024-11-11 10:27:34 -05:00
Brad King 962e4479d4 cmSystemTools: Clarify app bundle layout on macOS 2024-11-11 10:27:34 -05:00
Brad King 56632ddaa3 cmSystemTools: Remove redundant filesystem access on Windows
Since commit 823e1df54c (cmSystemTools: Implement GetRealPath on
Windows, 2024-11-04), GetRealPath now returns the actual case
on disk.  It also returns the original path on failure.
2024-11-11 10:27:34 -05:00
Brad King f2b3907cd0 cmSystemTools: Move static data to anonymous namespace 2024-11-11 10:27:33 -05:00
Brad King 87cb3036e5 Merge topic 'file-LOCK-windows'
8e810f8a7e cmFileLock: Fix implementation on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9976
2024-11-11 09:39:45 -05:00
Kitware Robot 0c93e086b7 CMake Nightly Date Stamp 2024-11-11 00:03:01 -05:00
Kitware Robot 34ebc4bc14 CMake Nightly Date Stamp 2024-11-10 00:01:20 -05:00
Kitware Robot 23e24788ab CMake Nightly Date Stamp 2024-11-09 00:01:15 -05:00
Alexander Neumann 8e810f8a7e cmFileLock: Fix implementation on Windows
Fixes: #26428
2024-11-08 12:52:13 -05:00
Brad King ed7910b642 Merge topic 'refactor-documentation-formatter'
dd0142e6d0 cmDocumentationFormatter: Refactor the `PrintFormatted()` method
ef88ec41f3 testDocumentationFormatter: Add some more test cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9979
2024-11-08 11:54:19 -05:00
Kitware Robot faf6954efa CMake Nightly Date Stamp 2024-11-08 00:01:49 -05:00
Alex Turbov dd0142e6d0 cmDocumentationFormatter: Refactor the PrintFormatted() method
- Introduce the `std::string Format(std:string)` method
- Simplify the algorithm to use `cmTokenizedView()` instead of pointers manipulation and slow iostreams
- Formatted text chunks are collected as a sequence of string views to join once at the end
2024-11-07 20:46:37 +04:00
Brad King 8353e6ab8d Merge topic 'vs-custom-command-disable-parallel-build'
4ee8705b12 VS: add source property VS_CUSTOM_COMMAND_DISABLE_PARALLEL_BUILD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9958
2024-11-07 10:07:03 -05:00
Brad King 3a51367548 Merge topic 'refactor-cmTokenize'
f3f70c2f90 StringAlgorithms: Refactor `cmTokenize()` function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9944
2024-11-07 10:06:04 -05:00
Brad King 15d9db0af3 Merge topic 'update-kwsys'
d269f82015 Merge branch 'upstream-KWSys' into update-kwsys
9b1a873de8 KWSys 2024-11-06 (81583094)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9975
2024-11-07 10:04:44 -05:00
Brad King d3edfba804 Merge topic 'ninja-regenerate-scripts'
f50fb77a4f Ninja: Regenerate when test or install scripts are missing
79349dee01 cmake: Always update timestamps on test and install scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9923
2024-11-07 10:03:32 -05:00
Brad King c417507523 Merge topic 'ctest-remove-handlers'
2b052ad5ca cmCTestUploadCommand: Remove handler usage
db3ccdce41 cmCTestUploadHandler: Move class into cmCTestUploadCommand.cxx
1b8f9274b2 cmCommand: Remove
8768a0c6e1 cmCTest*Command: Port away from cmCommand
c98ed10d0f cmCTest*Command: Declare member functions const
0e995d4897 cmCTest*Command: Direct use of cmExecutionStatus
26a697f7c1 cmCTest*Command: Access Makefile through an alias
caa449493b cmCTest*Command: Fortify argument parsing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9968
2024-11-07 10:02:05 -05:00
Kitware Robot 524aa61c59 CMake Nightly Date Stamp 2024-11-07 00:01:55 -05:00
Darragh Coy 4ee8705b12 VS: add source property VS_CUSTOM_COMMAND_DISABLE_PARALLEL_BUILD
This boolean setting allows parallel building to be disabled for
individual source files built via `add_custom_command`. Using this
option is equivalent to setting policy `CMP0147` to the `OLD` behavior.

Closes: #26413
2024-11-06 13:29:57 -05:00
Alex Turbov f3f70c2f90 StringAlgorithms: Refactor cmTokenize() function
- Refactor and optimize the loop to make it shorter and faster
- Make it push elements into an arbitrary (templated) output iterator
- Make it a template on a separator type with the most used defaults
- Add a backward compatible signature to return `std::vector<std::string>`
- Add an alternative function `cmTokenizedView()` to return a vector of string views
2024-11-06 18:42:17 +04:00
Brad King d269f82015 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2024-11-06 (81583094)
2024-11-06 09:24:07 -05: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
Martin Duffy 79349dee01 cmake: Always update timestamps on test and install scripts
Since commit d46d8df0ed (ENH: Re-implemented cmGeneratedFileStream to
... replace the destination file atomically, 2004-11-03, v2.4.0~2578) we
have generated `cmake_install.cmake` scripts with "copy-if-different"
semantics such that their timestamp is only updated when their contents
change.  In commit d395b563ed (ENH: ... test files are written by local
generator, 2005-04-24, v2.4.0~1842) we copied the approach for
generating `CTestTestfile.cmake` scripts.

In both cases, preserving timestamps is not needed and was only a side
effect of using `cmGeneratedFileStream` to replace the generated files
atomically.  Drop the "copy-if-different" semantics and always update
their timestamps so it is possible to know when they have been
regenerated.
2024-11-06 08:35:57 -05:00
Kitware Robot a99af46c3d CMake Nightly Date Stamp 2024-11-06 00:01:34 -05:00
Brad King cf0b482d8d Merge topic 'realpath-windows'
16af27fd42 cmSystemTools: Drop GetRealPathResolvingWindowsSubst
823e1df54c cmSystemTools: Implement GetRealPath on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9973
2024-11-05 09:10:02 -05:00
Brad King 85d0e377f7 Merge topic 'LINKER-prefix-generalization'
61aee8c7bd Add support of "LINKER:" prefix for Windows executable creation
8bcf9c7a3e Add support of "LINKER:" prefix for artifact creation flags
2bd4c06c26 Refactoring cmRulePlaceHolderExpander: propagate cmBuildStep information
35350c419d Add support of "LINKER:" prefix for CMAKE_<TYPE>_LINKER_FLAGS variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9922
2024-11-05 09:08:44 -05:00
Brad King bc09ea1eb5 Merge topic 'getopt-ifset'
17ee28728b cmCPackGenerator: Add GetOptionIfSet() to avoid duplicate calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9972
2024-11-05 09:04:37 -05:00
Daniel Pfeifer 2b052ad5ca cmCTestUploadCommand: Remove handler usage 2024-11-05 10:20:12 +01:00