9826 Commits

Author SHA1 Message Date
Ben Boeckel
a67da2ef66 Tests/FortranModules: add case for modules after "end interface X"
When there is an `end interface X` in a file, subsequent modules should
not be considered part of interface X.

Issue: #24203
2022-11-30 06:39:48 -05:00
Brad King
90907c8ff9 Merge topic 'try_compile-copy-config' into release-3.25
80fc564dd7 try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !7948
2022-11-23 07:09:09 -05:00
Brad King
80fc564dd7 try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATION
Since commit 0c141b0393 (try_compile: Record output location instead of
reverse computing it, 2022-08-31, v3.25.0-rc1~154^2) we always look for
the "Debug" configuration's output binary from the test project.
Restore looking for the `CMAKE_TRY_COMPILE_CONFIGURATION`.

Fixes: #24180
2022-11-22 11:26:28 -05:00
Marc Chevrier
61075d2d7b XCode: ensure LINK_LIBRARY genex is usable with XCODE_LINK_BUILD_PHASE_MODE
Fixes: #24176
2022-11-22 16:44:45 +01:00
Brad King
818ea1e497 Merge topic 'test-FindBoost-python-versions' into release-3.25
6b1f933cb8 Tests: Update FindBoost.TestPython for Python 3.11 and 3.12

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7929
2022-11-17 08:06:18 -05:00
Brad King
6b1f933cb8 Tests: Update FindBoost.TestPython for Python 3.11 and 3.12
Follow up the python 3.11 and 3.12 support from:

* commit 43844c5d82 (FindPython: Add support for Python 3.11,
                     2021-12-07, v3.22.2~20^2)
* commit ca2877c039 (FindPython: add support for Python 3.12,
                     2022-05-11, v3.23.2~15^2)

with an update for the FindBoost test.
2022-11-16 14:34:07 -05:00
Brad King
94164ea55e CMP0141: Fix PCH REUSE_FROM when MSVC_DEBUG_INFORMATION_FORMAT is empty
Under the policy's NEW behavior, `[CMAKE_]MSVC_DEBUG_INFORMATION_FORMAT`
may be explicitly set to an empty string to tell CMake not to add any
flags for this abstraction.  In this case, fall back to checking the
language-wide flags as we do in the OLD behavior.

This revises commit 183b9a9eca (CMP0141: Fix PCH REUSE_FROM under policy
NEW behavior, 2022-10-31, v3.25.0-rc3~4^2).

Issue: #24106
2022-11-15 06:57:02 -05:00
Ben Boeckel
0e9782b336 msvc: bless MSVC 19.34 support for C++ modules as experimental
Visual Studio 17.4 now contains official support for what CMake needs.
2022-11-11 16:54:05 -05:00
Brad King
93ff726114 Tests: Fix TryCompile bad source case for clang-cl 15 on Windows
When `pass.c bad#source.c` passes through `nmake`, the compiler gets
`pass.c bad`.  The clang-cl 15 compiler now fails on `bad` with an
error that we did not previously match.  Update our regex.
2022-11-10 12:57:55 -05:00
Brad King
cb53d9309e block: Fix variable scope protection from modification by subdirectories
When `cmStateSnapshot::RaiseScope` raises a variable in to a parent
directory scope, it uses `GetBuildsystemDirectoryParent` to find the
current top-most scope on the directory's stack.  Since commit 3f4e5e8c3d
(cmState: Return end snapshot for GetBuildsystemDirectoryParent.,
2015-09-01, v3.4.0-rc1~100^2~1), that depends on the `DirectoryEnd`
field in the directory's state.  However, when variable-only scopes were
added by commit 6954c8936f (cmState: Add a VariableScope snapshot type.,
2015-08-01, v3.4.0-rc1~179^2~1), we neglected to account for the
addition of that field by commit 52dbe654de (cmState: Record the end
position of each directory., 2015-08-01, v3.4.0-rc1~251^2~1).

Prior to commit 44a2f3f332 (Add new flow-control commands for variables
and policies scopes management, 2022-08-05, v3.25.0-rc1~257^2) this
problem went unnoticed because there was no way to have a variable scope
at the top of a directory's stack while processing a subdirectory. Now
the `block()/endblock()` commands enable the behavior, so fix tracking
of a variable scope as the top-most scope in a directory.

Fixes: #24138
2022-11-07 14:24:24 -05:00
Sean McBride
9684a589ca Source: Replace uses of sprintf with safer snprintf in CMake 3.24 branch
Backport commit d5694e4623 (Source: Replace uses of sprintf with safer
snprintf, 2022-06-17, v3.25.0-rc1~587^2) to the CMake 3.24 branch. This
is needed to compile without warnings using Xcode 14.1's macOS 13.0 SDK.
2022-11-03 11:58:31 -04:00
Brad King
32352abbd1 Merge topic 'correct_nvptxcompiler_not_linking_to_threads' into release-3.25
62f13ed588 FindCUDAToolkit: Restore usage from multiple directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7859
2022-11-03 08:15:12 -04:00
Brad King
cb4e6702b2 Xcode: Implement Swift include directories
Populate Xcode's `SWIFT_INCLUDE_PATHS` build setting with the
target-wide include directories.

Issue: #24116
2022-11-02 17:03:21 -04:00
Robert Maynard
62f13ed588 FindCUDAToolkit: Restore usage from multiple directories
Fixes #24119
2022-11-02 12:23:30 -04:00
Brad King
183b9a9eca CMP0141: Fix PCH REUSE_FROM under policy NEW behavior
Under the CMP0141 NEW behavior added by commit 0e96a20478 (MSVC: Add
abstraction for debug information format, 2022-08-25, v3.25.0-rc1~142^2~1),
the `-Zi` and `-ZI` flags do not appear in `CMAKE_<LANG>_FLAGS_<CONFIG>`
anymore.  Teach the PCH REUSE_FROM implementation to recognize the
`EditAndContinue` and `ProgramDatabase` debug information formats
through the policy's new abstraction.

Fixes: #24106
2022-10-31 12:19:06 -04:00
Brad King
4d13f472a2 Tests: Drop redundant project init from RunCMake.PrecompileHeaders cases
The `CMakeLists.txt` file already calls `cmake_minimum_required` and
`project` before including each case's code.
2022-10-31 12:17:29 -04:00
Brad King
bb171688c9 Merge topic 'vs-dotnetsdk-arm64' into release-3.25
9a0ca7df67 Tests: Fix RunCMake.VsDotnetSdk with VS >= 17.3 on ARM64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7842
2022-10-31 09:45:12 -04:00
Brad King
d69b77a9ca Merge topic 'ninja-showIncludes-encoding' into release-3.25
a0d4e3bf34 cmGeneratedFileStream: Drop unused WriteRaw method
2e5af30ce0 Ninja: Match showIncludes dependencies using console output code page
e1c1679148 cm_codecvt: Add support for the Windows console output code page
328c15189d cmGeneratedFileStream: Add support for a temporary alternate encoding

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7845
2022-10-31 09:44:11 -04:00
Brad King
2e5af30ce0 Ninja: Match showIncludes dependencies using console output code page
Generalize the fix from commit 37a279f8d1 (Ninja: Write msvc_deps_prefix
as UTF-8 when console codepage is UTF-8, 2020-07-31, v3.19.0-rc1~349^2).
`cl /showIncludes` output is encoded using the console output code page,
so this is the byte sequence that Ninja must use to match its lines.

Fixes: #24068
2022-10-30 08:29:55 -04:00
Brad King
024e3d2bf6 Xcode: Put object files in a place that Xcode cleans
Since commit dc5fc898f6 (Xcode: Set object file locations using
TARGET_TEMP_DIR, 2022-09-29, v3.25.0-rc1~64^2~1), `xcodebuild clean`
does not remove the object files in our explicit `TARGET_TEMP_DIR`
because it is not under the `SYMROOT`.  Put it there.

Fixes: #24096
2022-10-28 15:38:07 -04:00
Anthony Roberts
9a0ca7df67 Tests: Fix RunCMake.VsDotnetSdk with VS >= 17.3 on ARM64
VS 17.3 provides an arm64-native version of the tool, but the test was
looking for the x64 version.
2022-10-28 11:19:25 -04:00
Brad King
33d610a076 Merge topic 'cmake-presets-workflow-arguments' into release-3.25
7ecbe324b0 cmake --workflow: add --fresh option
7d9aa0f00c cmake::Workflow: Refactor to use enum class argument
322193afcd cmake --workflow: print usage and exit on unrecognized argument
70aef29427 cmake --workflow: print usage message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7825
2022-10-27 09:43:38 -04:00
Brad King
7d181917de Merge topic 'xcode-swift-defs' into release-3.25
c0dd3dd2c1 Xcode: Evaluate Swift compile definitions separately

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7826
2022-10-27 09:42:02 -04:00
Brad King
74057c72d6 Merge topic 'ninja-intl-paths' into release-3.25
a12050666c Tests: Add case for ninja with non-ascii chars
02a04dd9c7 Ninja: Restore support for non-ascii paths on Windows with ninja<=1.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7833
2022-10-27 09:26:34 -04:00
Brad King
e677cc421d Merge branch 'ninja-intl-paths' into release-3.24
Merge-request: !7833
2022-10-27 09:24:46 -04:00
Brad King
a12050666c Tests: Add case for ninja with non-ascii chars
Issue: #24089
2022-10-26 15:25:45 -04:00
Kyle Edwards
7ecbe324b0 cmake --workflow: add --fresh option
Fixes: #24073
2022-10-26 12:01:25 -04:00
Kyle Edwards
322193afcd cmake --workflow: print usage and exit on unrecognized argument
Issue: #24073
2022-10-26 12:00:57 -04:00
Brad King
883798edc4 Merge topic 'try_compile-CMP0128' into release-3.25
90287792b6 Tests: Avoid running C++11 test on GNU < 4.7

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7821
2022-10-25 14:26:17 -04:00
Brad King
c0dd3dd2c1 Xcode: Evaluate Swift compile definitions separately
Xcode has a separate setting for Swift compile definitions, so we can
compute a dedicated value for it.  Therefore we can:

* Support the COMPILE_LANGUAGE generator expression for Swift-specific
  filters.

* Avoid passing the `=value` part of definitions, which Swift does
  not support.

This revises commit 5cb625eb2f (Xcode: Pass compile definitions to
Swift, 2022-06-19, v3.25.0-rc1~493^2) and reverts commit 12c6fec6b4
(Xcode: Drop CMAKE_INTDIR= definition in Swift targets, 2022-09-30,
v3.25.0-rc1~60^2~2), as the latter is no longer needed.

Fixes: #24086
2022-10-25 14:09:28 -04:00
Brad King
6f2e8bace1 Merge branch 'try_compile-CMP0128' into release-3.24
Merge-request: !7821
2022-10-25 10:35:30 -04:00
Brad King
90287792b6 Tests: Avoid running C++11 test on GNU < 4.7
The test added in commit 50e90e2828 (try_compile: Honor CMP0128 setting
in test project, 2022-10-18, v3.25.0-rc2~4^2) requires that the compiler
support C++11 mode, so do not run it on GNU compilers that are too old.
2022-10-24 12:04:57 -04:00
Brad King
32c0f964bc Merge topic 'test-git-protocol-file' into release-3.25
79ce0f434e Tests: Explicitly allow usage of git file-based protocol in test cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7812
2022-10-21 10:05:18 -04:00
Brad King
79ce0f434e Tests: Explicitly allow usage of git file-based protocol in test cases
Due to CVE-2022-39253, Git 2.30.6 sets `protocol.file.allow=user` by
default.  The change has also been backported to other Git versions by
distros.  This breaks some of our test cases that use the file-based
protocol locally to simulate real workflows without requiring network
access.  In these cases the file protocol is safe, so explicitly enable
it in the tests.
2022-10-20 13:45:01 -04:00
Brad King
6fa189f716 Merge topic 'cmake-presets-output-junit' into release-3.25
bea4ed5430 CTest: Add support for outputJUnitFile in presets
9270a02003 CMakePresets.json: Add outputJUnitFile to test presets schema
757786bb73 Tests: Add test for outputLogFile in CMakePresets.json
b68c3596e7 CMakePresets.json: Disallow extra properties in test output schema

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !7806
2022-10-19 10:04:29 -04:00
Brad King
177c56e3fa Merge topic 'try_compile-CMP0128' into release-3.25
50e90e2828 try_compile: Honor CMP0128 setting in test project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !7803
2022-10-19 09:57:08 -04:00
Kyle Edwards
bea4ed5430 CTest: Add support for outputJUnitFile in presets
Fixes: #22400
2022-10-18 16:52:23 -04:00
Kyle Edwards
757786bb73 Tests: Add test for outputLogFile in CMakePresets.json 2022-10-18 15:20:44 -04:00
Kyle Edwards
b68c3596e7 CMakePresets.json: Disallow extra properties in test output schema
And add test for testOutputTruncation being unsupported.
2022-10-18 14:40:11 -04:00
Brad King
588c9c4145 Merge branch 'try_compile-CMP0128' into release-3.24
Merge-request: !7803
2022-10-18 14:25:52 -04:00
Brad King
599e49cf9b Merge topic 'revert_nvcc_marking_include_as_system' into release-3.25
d0e52219eb CUDA: Revert "Always mark cuda toolkit as system include"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7798
2022-10-18 13:45:56 -04:00
Brad King
50e90e2828 try_compile: Honor CMP0128 setting in test project
Some projects pass a raw `-std=` flag to the compiler in the
`try_compile` project.  If they do not set CMP0128 to NEW,
we should not append a `-std=` flag where we did not before
the policy was added.

Fixes: #24063
2022-10-18 13:38:00 -04:00
Robert Maynard
d0e52219eb CUDA: Revert "Always mark cuda toolkit as system include"
We need to revert this change as it can disable error messages
when compiling invalid CUDA code.

This reverts commit ea659b155d (CUDA: Always mark cuda toolkit as system
include, 2022-06-27, v3.25.0-rc1~269^2).
2022-10-17 10:17:33 -04:00
Marc Chevrier
4aa86da827 Xcode: ensure framework with custom output directory can be consumed
Fixes: #24046
2022-10-14 09:13:37 -04:00
Brad King
f3bb1c8d7f Merge topic 'flang-implicit-link-info' into release-3.25
0301779e85 LLVMFlang: Add support for mixed-language linking with Fortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7781
2022-10-12 09:17:47 -04:00
Brad King
0301779e85 LLVMFlang: Add support for mixed-language linking with Fortran
Parse implicit link information for this compiler to support
mixed-language linking.  This was missed by commit 85749766df
(LLVMFlang: Add support for LLVM Flang, 2021-07-07, v3.24.0-rc1~86^2).
Also activate mixed-language test cases that would have caught this.

Issue: #22387
2022-10-11 15:38:48 -04:00
Brad King
2905210999 Merge topic 'test-RunCMake.install'
e73470991f Tests: Loosen RunCMake.install directory symlink expected output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7775
2022-10-11 09:52:33 -04:00
Brad King
4507237960 Merge topic 'verify-header-sets-iwyu'
6942234bf5 VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma: associated to verification file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7762
2022-10-10 10:21:09 -04:00
Brad King
1fea40c85a Merge topic 'cuda_sanitizer_false_positives'
59fcbba65e ctest_memcheck: ignore false-positives in CUDA's compute-sanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7760
2022-10-10 10:19:56 -04:00
Brad King
e73470991f Tests: Loosen RunCMake.install directory symlink expected output
The case added by commit 85f01a1ec2 (file(INSTALL): Improve formatting
of symlink creation error, 2022-10-06) may print `Up-to-date:` or
`Installing:` for the file inside a symlinked directory based on
filesystem timestamp granularity.  Since that output is not what the
test intends to cover, simply accept either possibility.
2022-10-10 09:55:43 -04:00