Commit Graph

67907 Commits

Author SHA1 Message Date
Brad King
37035746e2 Merge topic 'doc-CMP0132'
aae8d604d5 Help: Add missing one-line summary to policy CMP0132

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9986
2024-11-11 13:55:19 -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
Brad King
aae8d604d5 Help: Add missing one-line summary to policy CMP0132
This was missed in commit 05e510bf0b (CMP0132: Don't set compiler
environment variables on first run, 2022-03-23, v3.24.0-rc1~380^2).
2024-11-11 09:38:51 -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
Brad King
b89610b5fa Merge topic 'apple-compiler-selection'
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
3b8b70fe72 macOS: Simplify logic converting CMAKE_OSX_SYSROOT to a path
c55c113076 macOS: Revert finding tools inside Xcode that are not in the PATH
77fcee9204 macOS: Revert "Resolve compiler in /usr/bin to that reported by Xcode xcrun"
9eb530842c Tests/RunCMake/CMakePresets: Do not forward empty CMAKE_MAKE_PROGRAM
7fb14e707d Tests/RunCMake/XcFramework: Use macosx SDK in all multi-arch macOS cases
70ff1f15fc Tests/CTestTest*: Detect compiler from environment
1faf60cffc Tests/FortranC: Handle empty CMAKE_OSX_SYSROOT
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: FX Coudert <fxcoudert@gmail.com>
Merge-request: !9977
2024-11-08 11:50:31 -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
Alex Turbov
ef88ec41f3 testDocumentationFormatter: Add some more test cases 2024-11-07 20:08: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
Brad King
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
On modern macOS, compiler wrappers like `/usr/bin/cc` automatically
choose a SDK to pass via `-isysroot` to an underlying compiler from
Xcode or the CommandLineTools.  Other toolchains like Homebrew's `gcc-*`
come with a default SDK too.  Therefore, when targeting macOS, we no
longer need to choose any SDK or pass an `-isysroot` flag by default.

Update initialization of `CMAKE_OSX_SYSROOT` to be empty by default when
targeting macOS.

Fixes: #19180
2024-11-07 09:46:10 -05:00
Brad King
3b8b70fe72 macOS: Simplify logic converting CMAKE_OSX_SYSROOT to a path 2024-11-07 09:46:10 -05:00
Brad King
c55c113076 macOS: Revert finding tools inside Xcode that are not in the PATH
Since commit 03ab170fe0 (OS X: Enable command-line build without tools in
PATH, 2013-08-05, v2.8.12~111^2) we find compilers such as

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

when there is no corresponding compiler in the PATH.  However, modern
macOS versions always have `/usr/bin/cc` in the PATH, so this code path is
never taken (similarly for `make`).  Even if it were, the compilers in
Xcode cannot be used by build systems that do not add an `-isysroot` flag.
Instead, they should be used through the `/usr/bin/cc` wrapper, which
internally calls Xcode's compiler with a default `-isysroot` flag.
2024-11-07 09:46:09 -05:00
Brad King
77fcee9204 macOS: Revert "Resolve compiler in /usr/bin to that reported by Xcode xcrun"
Revert commit 1f085e11e4 (OS X: Resolve compiler in /usr/bin to that
reported by Xcode xcrun, 2015-01-03, v3.2.0-rc1~126^2~1).  The compilers
in Xcode cannot be used by build systems that do not add an `-isysroot`
flag.

Issue: #19180
2024-11-07 09:46:09 -05:00
Brad King
9eb530842c Tests/RunCMake/CMakePresets: Do not forward empty CMAKE_MAKE_PROGRAM 2024-11-07 09:46:09 -05:00
Brad King
7fb14e707d Tests/RunCMake/XcFramework: Use macosx SDK in all multi-arch macOS cases
We select the list of macOS architectures based on the version of Xcode.
Therefore we should use a macosx SDK that comes with Xcode to make sure
it has all the selected architectures.  For example, on macOS 10.15 the
system `/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk` SDK
may have only `x86_64`, but Xcode 12 can be installed with SDKs that
support both `arm64` and `x86_64`.
2024-11-07 09:46:09 -05:00
Brad King
70ff1f15fc Tests/CTestTest*: Detect compiler from environment
Three of these tests were still using the compiler selected for building
CMake itself.  In general our test suite is supposed to let each test
select the compiler from the environment.  This is particularly
important on macOS where CMake might be built with compilers inside
Xcode, which require an explicit `CMAKE_OSX_SYSROOT`.
2024-11-07 09:46:09 -05:00
Brad King
1faf60cffc Tests/FortranC: Handle empty CMAKE_OSX_SYSROOT
The compiler inside Xcode requires an explicit `-isysroot`.
Replace it with the `/usr/bin/cc` wrapper.
2024-11-07 09:45:54 -05:00
Brad King
87a9e50995 Tests: Add missing include in sleep sources
Sources that use `atoi` need to include `<stdlib.h>`.
2024-11-07 09:45:54 -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
KWSys Upstream
9b1a873de8 KWSys 2024-11-06 (81583094)
Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 81583094b092d08e153e4966224639c7b257d25c (master).

Upstream Shortlog
-----------------

Brad King (1):
      30e9db2d SystemTools: Drop GetActualCaseForPathCached
2024-11-06 09:24:06 -05:00
Brad King
9c02fad126 Merge branch 'release-3.31' 2024-11-06 09:13:36 -05:00
Brad King
e22c8383b9 CMake 3.31.0 v3.31.0 2024-11-06 08:41:37 -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
bda742578d Merge topic 'test-RunCMake.CTestTimeout'
f3f0cb31a2 Tests/RunCMake/CTestTimeout: Improve reliability when running on busy hosts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9974
2024-11-05 09:05:20 -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
Brad King
3f6164d9c4 Merge topic 'doc-CheckTypeSize'
b71ed8ce05 CheckTypeSize: Add code examples

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9971
2024-11-05 09:03:03 -05:00
Brad King
d1151e424f Merge topic 'doc-CheckTypeSize'
b76009bb5a CheckTypeSize: Document default language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9967
2024-11-05 09:01:16 -05:00
Daniel Pfeifer
2b052ad5ca cmCTestUploadCommand: Remove handler usage 2024-11-05 10:20:12 +01:00
Daniel Pfeifer
db3ccdce41 cmCTestUploadHandler: Move class into cmCTestUploadCommand.cxx
Place declaration and definitions into places where following
refactoring will cause minimal deltas.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
1b8f9274b2 cmCommand: Remove
Finally. All commands are immutable.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
8768a0c6e1 cmCTest*Command: Port away from cmCommand
Copy the necessary parts, but remove cloning and make all commands
immutable.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
c98ed10d0f cmCTest*Command: Declare member functions const 2024-11-05 10:20:12 +01:00
Daniel Pfeifer
0e995d4897 cmCTest*Command: Direct use of cmExecutionStatus
Make sure that getting Makefile and setting Error is both done
through a `status` argument rather than through `cmCommand`.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
26a697f7c1 cmCTest*Command: Access Makefile through an alias
At the top of each function that requires access to Makefile,
declare an alias `mf = this->Makefile`.  Then replace all occurrences
of `this->Makefile->` with `mf.`.  The intention is to make following
changes easier to review.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
caa449493b cmCTest*Command: Fortify argument parsing
Fix tests that pass `CDASH_UPLOAD` or `SCHEDULE_RANDOM` without an argument.
2024-11-05 10:20:12 +01:00