Commit Graph

34722 Commits

Author SHA1 Message Date
Brad King
4f26c238a6 Merge topic 'static-library-link-xcframework' into release-3.28
7d19246138 Xcode: Fix linking against .xcframework from static libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8949
2023-11-07 09:56:24 -05:00
Kyle Edwards
7d19246138 Xcode: Fix linking against .xcframework from static libraries
Issue: #21752
2023-11-06 17:40:00 -05:00
Brad King
ed154b3896 CMake 3.28.0-rc4 2023-11-06 11:50:13 -05:00
Kyle Edwards
c4be9c914b cmSystemTools::RunSingleCommand(): Pass stdin to child process
Fixes: #25383
2023-11-02 10:04:00 -04:00
Brad King
59c3ce4c83 Merge topic 'cxxmodules-cmp0155-graceful-fallback-without-scanner' into release-3.28
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:14 -04:00
Ben Boeckel
1f507580a1 cmGlobalGenerator: give context about module queries
Some queries are merely investigating support in order to change
behavior. Let the method know so that any internal errors can be skipped
over.
2023-11-01 09:52:13 -04: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
Cristian Adam
2553a78aa7 ctest: Allow colored output on Windows if CLICOLOR_FORCE is set to 1
Windows 10 supports ANSI colors since v1511. For earlier versions of Windows
installing ANSICON will enable ANSI colors in cmd.exe.

For those setups where the environment is set up with CLICOLOR_FORCE set
to 1 ctest should honor the setting and emit colored ANSI output.
2023-11-01 09:43:59 -04:00
Brad King
3a515b31b3 Merge topic 'modules-depends-via-target-objects' into release-3.28
22da18b995 Fortran: Restore support for TARGET_OBJECTS providing modules
64d9240564 cmComputeLinkInformation: skip over linking to items for object purposes
035302b7e3 cmComputeLinkDepends: also copy the target from object link items
861876b936 Tests/ObjectLibrary: fix comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8923
2023-10-31 09:12:28 -04:00
Ben Boeckel
22da18b995 Fortran: Restore support for TARGET_OBJECTS providing modules
Continue b665966933 (cmComputeLinkInformation: track OBJECT library
dependencies, 2023-07-22) which added explicitly listed `OBJECT`
libraries to the list of targets which the collator needs to consider.
Now also consider targets which provide objects directly to the target
via a `$<TARGET_OBJECT>` source lists.

Also add tests which use target objects directly and through an
`INTERFACE` library with target objects in its own sources.

Fixes: #25365
2023-10-30 10:06:12 -04:00
Brad King
6474d5d03a Merge topic 'cxxmodules-ninja-forced-rsp-files' into release-3.28
09c962a6a4 Tests/CXXModules: test forced rsp files with ninja

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8926
2023-10-30 08:26:08 -04:00
Ben Boeckel
09c962a6a4 Tests/CXXModules: test forced rsp files with ninja
Fixes: #25367
2023-10-27 23:55:39 -04:00
Ben Boeckel
64d9240564 cmComputeLinkInformation: skip over linking to items for object purposes
If a name is only found because it is a link entry of kind `Object`, do
not add anything to the link line.
2023-10-27 15:52:01 -04:00
Ben Boeckel
035302b7e3 cmComputeLinkDepends: also copy the target from object link items 2023-10-27 13:25:33 -04:00
Kyle Edwards
d3cc815c98 CMP0153: Add suggestion to use execute_process() 2023-10-27 09:43:18 -04:00
Kyle Edwards
8313d26198 cmState::AddDisallowedCommand(): Allow additional warning info 2023-10-27 09:42:53 -04:00
Brad King
e3747a2d4b CMake 3.28.0-rc3 2023-10-24 13:46:27 -04:00
Brad King
81dc8b9db8 Merge topic 'cmcldeps-quote-rc' into release-3.28
03080d18eb cmcldeps: Restore support for rc.exe path not fully GetShortPathName-d

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8912
2023-10-24 08:29:08 -04:00
Brad King
03080d18eb cmcldeps: Restore support for rc.exe path not fully GetShortPathName-d
In some cases `GetShortPathNameW` may not remove all spaces.  If that
happens with the path to `rc.exe`, cmcldeps needs to explicitly quote
the path in the command it runs.

This was exposed by commit 50a6e78a82 (cmSystemTools::RunSingleCommand():
Replace cmsysProcess with cmUVProcessChain, 2023-07-25, v3.28.0-rc1~138^2~4)
because the underlying process execution library no longer reconstructs the
command line without quotes around commands without spaces.

Fixes: #25355
2023-10-23 17:03:01 -04:00
Brad King
8bb949fc30 source_group: Restore behavior of TREE with empty FILES
Since commit d85238a2f2 (source_group: Fix TREE without FILES,
2023-06-29, v3.28.0-rc1~399^2~1) we incorrectly treat a FILES
argument with no values as if it were not given at all.

Fixes: #25353
2023-10-23 10:53:28 -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
Ben Boeckel
0973cd6702 cmNinjaTargetGenerator: use the file set visibility API 2023-10-19 23:09:33 -04:00
Ben Boeckel
4625170925 cmFileSet: add a query for includeable file set types 2023-10-19 23:09:33 -04:00
Ben Boeckel
51f9d9f0a2 cmNinjaTargetGenerator: avoid traversing old outputs repeatedly
We actually only need to look at outputs just added to the vector, not
all outputs that have been detected so far.
2023-10-19 23:09:33 -04:00
Brad King
c2b28d4a66 CMake 3.28.0-rc2 2023-10-18 13:15:13 -04:00
Brad King
dc7bed55e6 Merge topic 'cxxmodules-vs-no-synthetic-targets' into release-3.28
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:52 -04: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
84ac583bc6 Merge topic 'cxxmodules-export-fileset-info' into release-3.28
0f36156740 cxxmodules: include `INCLUDES DESTINATION` directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8886
2023-10-17 09:50:06 -04:00
Brad King
ec916350db Merge topic 'execute_process-output_file-directory' into release-3.28
35f031e3b2 execute_process(): Restore opening files relative to WORKING_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8883
2023-10-17 09:41:38 -04:00
Ben Boeckel
0f36156740 cxxmodules: include INCLUDES DESTINATION directories
These paths are added outside the normal property management mechanisms.
Shuttle the value to the C++ module export as needed.

Fixes: #25289
2023-10-16 13:57:54 -04:00
Kyle Edwards
35f031e3b2 execute_process(): Restore opening files relative to WORKING_DIRECTORY
Prior to 5420639a, execute_process() would open INPUT_FILE, OUTPUT_FILE,
and ERROR_FILE relative to the WORKING_DIRECTORY argument if it was
provided. Restore this behavior for backwards compatibility.

Fixes: #25338
2023-10-16 12:23:41 -04:00
Orkun Tokdemir
c074f5c81e Autogen: Revert "AUTO*_EXECUTABLE: add support for per-config values"
Changing the `timestamp` file to `timestamp_$<CONFIG>` causes some user
projects to break when using Qt versions older than 6.6.

Revert commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for
per-config values, 2023-06-14, v3.28.0-rc1~96^2~1) pending further
investigation.

Issue: #20074
2023-10-13 14:16:26 -04:00
Brad King
38643edc2d CMake 3.28.0-rc1 2023-10-11 14:33:33 -04:00
Brad King
581a03a138 Merge topic 'cxxmodules-try_compile' into release-3.28
fd81024e80 cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8865
2023-10-11 10:31:05 -04:00
Brad King
32438138c3 cxxmodules: Reference documentation in no-modules-support diagnostics
Help users avoid errors about module support when they may not need it.

While at it, polish sentence syntax in the diagnostic messages.
2023-10-11 09:52:41 -04:00
Brad King
fd81024e80 cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compile
Under CMP0155's NEW behavior, projects that explicitly enable C++20
support with `set(CMAKE_CXX_STANDARD 20)` may also explicitly
disable scanning with `set(CMAKE_CXX_SCAN_FOR_MODULES OFF)`.
We already propagate `CMAKE_CXX_STANDARD` into `try_compile` test
projects, so propagate `CMAKE_CXX_SCAN_FOR_MODULES` too.

Fixes: #25313
2023-10-10 11:25:21 -04:00
Brad King
9532e1cf5b CMake 3.27.7 2023-10-06 09:08:35 -04:00
Brad King
b8ead378de cxxmodules: Scan only targets that explicitly enable C++ 20
Previously we scanned any targets for which C++ 20 is enabled,
even if enabled only by the compiler's default, such as when
`CXXFLAGS=-std=c++20`.
2023-10-05 13:17:00 -04:00
Brad King
68fca3eafe cmGeneratorTarget: Track explicitly enabled language standard levels
Previously we only tracked when an explicit setting requires the
standard level to be higher than the compiler's default.
2023-10-05 13:16:24 -04:00
Brad King
da36e0638b cmGeneratorTarget: Remove outdated const/mutable pair 2023-10-04 18:45:30 -04:00
Brad King
c1f1aedcee cmStandardLevelResolver: Add method to look up standard level by name 2023-10-04 18:44:44 -04:00
Brad King
23b57462aa cmStandardLevelResolver: Report feature std level from GetNewRequiredStandard
Regardless of whether the feature requires a new (higher) standard
level, always report the standard level that the feature needs.
2023-10-04 18:44:18 -04:00
Brad King
7519001ae6 cmStandardLevelResolver: Add method to get feature standard level 2023-10-04 18:15:04 -04:00
Brad King
99fa01d3fa cmStandardLevelResolver: Factor out public representation of level 2023-10-04 17:14:58 -04:00
Brad King
fdd81a609a cmStandardLevelResolver: Clarify local variable name 2023-10-04 17:14:58 -04:00
Brad King
73a1d422a5 cmStandardLevelResolver: Mark builtin language standards table as const 2023-10-04 17:14:58 -04:00
Brad King
7ac696549a cxxmodules: Fix CMP0155 NEW behavior when C++ compile features are not known
With CMP0155 NEW behavior, we scan C++ sources in targets using C++ 20,
i.e., in which the `cxx_std_20` feature is available.  However, our
check for C++ feature availability may incorrectly succeed in two cases:

* MSVC versions from VS 2013 do not model C++ standard levels,
  so we assume all features are available as a heuristic to let
  projects at least try compiling with them.

* During ABI detection the `CMAKE_CXX20_COMPILE_FEATURES` variable is not
  populated so we assume all features are available, knowing that our
  ABI detection project does not need them.

For purposes of detecting targets using C++ 20, we do not want to assume
`cxx_std_20` is available, so verify that we really know it is.
2023-10-03 16:06:46 -04:00
Brad King
8bd2c8d1fd Begin 3.28 release versioning 2023-10-03 11:22:54 -04:00
Brad King
cbc0fd68a5 Merge topic 'cmDebugTools-add-header'
b0612796b1 cmDebugTools: add header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8849
2023-10-03 09:28:51 -04:00
Kitware Robot
94c90cb855 CMake Nightly Date Stamp 2023-10-03 00:01:13 -04:00