Commit Graph

35334 Commits

Author SHA1 Message Date
Brad King
cdc901797a CMake 3.29.6 2024-06-17 14:49:43 -04:00
Brad King
9b672e8075 VS: Quote custom command arguments containing semicolons
The `GoogleTest` module needs this to pass the `TEST_EXECUTOR`
definition to its `GoogleTestAddTests.cmake` helper script in
the `POST_BUILD` command since commit f875c479f5 (GoogleTest: Honor
TEST_LAUNCHER in gtest_discover_tests, 2024-01-17, v3.29.0-rc1~34^2).
Previously it worked only if other characters, such as spaces,
caused the argument to be quoted.  This was exposed by running the
`RunCMake.GoogleTest` test in a path without spaces.

Reported-by: Garrett Campbell <gcampbell@microsoft.com>
2024-06-14 08:24:21 -04:00
Brad King
facfba088f CMake 3.29.5 2024-06-06 08:57:14 -04:00
Joan Bruguera Micó
ff077af032 ctest: Set close-on-exec for jobserver FIFO
Set the close-on-exec flag to prevent the jobserver FIFO file
descriptor from leaking to subprocesses spawned by `ctest`.

This leak is usually harmless, but can cause `make test -jN` to hang
at the end of the build if a test leaves a background process running
with the jobserver FIFO file descriptor open.

Fixes: #26027
2024-06-05 09:37:05 -04:00
Brad King
efaa9efece CMake 3.29.4 2024-06-03 14:28:41 -04:00
Brad King
f2ea85f516 Merge topic 'update-kwsys' into release-3.29
98dd754b62 KWSys: ConsoleBuf: Fix test case when running under Windows Terminal

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9553
2024-05-29 08:30:10 -04:00
Brad King
98dd754b62 KWSys: ConsoleBuf: Fix test case when running under Windows Terminal
Our test case writes a NUL byte to the console to test its behavior.
The behavior of Windows Terminal differs from Windows Console Host
(conhost.exe).  Detect which of these is in use at runtime and adjust
our expected result accordingly.
2024-05-28 09:11:56 -04:00
Brad King
ea44e63a7c Merge topic 'cxxmodules-gcc-binary-mode' into release-3.29
9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9525
2024-05-17 11:16:16 -04:00
Brad King
32a8d5a4ac Merge topic 'cxxmodules-gcc-binary-mode' into release-3.28
9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9525
2024-05-17 11:15:38 -04:00
Ben Boeckel
9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap
GCC (MinGW) wants to use `\n` on Windows too.

Fixes: #25974
2024-05-16 09:54:16 -04:00
Brad King
19c2f8e1f3 Merge topic 'cmp0037-message' into release-3.29
c773d5b436 CMP0037: Restore diagnostic message for invalid ALIAS target names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !9519
2024-05-15 09:58:48 -04:00
Brad King
c773d5b436 CMP0037: Restore diagnostic message for invalid ALIAS target names
Refactoring in commit 7a4c02cb38 (cmGlobalGenerator: factor out
messaging for CMP0037, 2023-09-24, v3.28.0-rc1~39^2~7) incorrectly
switched to reporting the aliased target name instead of the invalid
name of the alias itself.

Fixes: #25979
2024-05-14 10:44:47 -04:00
Brad King
b39fb31bf4 CMake 3.29.3 2024-05-07 12:49:54 -04:00
Brad King
9f7ec4c297 CMake 3.28.5 2024-05-07 08:42:47 -04:00
Brad King
74a07abcc6 Merge topic 'cxxmodules-build-export-different-directory' into release-3.29
1fba6d3233 Merge branch 'cxxmodules-build-export-different-directory-3.28' into cxxmodules-build-export-different-directory
ec35251510 cmDyndepCollation: look at all `export(TARGETS)` calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9485
2024-05-03 09:23:35 -04:00
Brad King
1086902abd Merge topic 'cxxmodules-build-export-different-directory' into release-3.28
ec35251510 cmDyndepCollation: look at all `export(TARGETS)` calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9485
2024-05-03 09:13:18 -04:00
Brad King
a344140dfa Merge topic 'vs-scan-module-deps-settings' into release-3.29
3022f0363f VS: set ScanSourceForModuleDependencies at vcxproj level
dff511ad28 cmGeneratorTarget: add a target-level query for "needs dyndep"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: AaronRuizMoraUK <aaronruizmora@gmail.com>
Merge-request: !9471
2024-05-02 09:40:03 -04:00
Ben Boeckel
1fba6d3233 Merge branch 'cxxmodules-build-export-different-directory-3.28' into cxxmodules-build-export-different-directory
* cxxmodules-build-export-different-directory-3.28:
  cmDyndepCollation: look at all `export(TARGETS)` calls
2024-05-01 22:09:43 -04:00
Ben Boeckel
ec35251510 cmDyndepCollation: look at all export(TARGETS) calls
Previously, only `export()` calls in the same directory were noticed.

Also add a test that exports in a different directory than the target
itself resides in.

Fixes: #25813
2024-05-01 22:08:35 -04:00
Ben Boeckel
3022f0363f VS: set ScanSourceForModuleDependencies at vcxproj level
Implement the target-wide `CXX_SCAN_FOR_MODULES`/`CMP0155` selection
with the `.vcxproj`-wide `ScanSourceForModuleDependencies` setting.
Set the per-source equivalent only when needed for a per-source
`CXX_SCAN_FOR_MODULES` property.

This approach enables Intellisense for interfaces imported from modules.
It is also more consistent with what a user might expect when
investigating the state of module scanning from the VS property panels.

Fixes: #25806
Fixes: #25947
2024-05-01 09:54:50 -04:00
Ben Boeckel
dff511ad28 cmGeneratorTarget: add a target-level query for "needs dyndep"
This can still be overridden per-source, but it indicates the state of
the target's default behavior.
2024-05-01 09:41:07 -04:00
Brad King
4bf49bc437 Merge topic 'export-name-safe-name' into release-3.29
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9474
2024-05-01 09:29:55 -04:00
Brad King
f909fc2f92 Merge topic 'export-name-safe-name' into release-3.28
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9474
2024-05-01 09:28:59 -04:00
Brad King
c5d8fa3f2c Merge topic 'exported-modules-with-headers' into release-3.29
2041f7c9bf cmGeneratorTarget: add the original target as a COMPILE_ONLY link
051c2110c8 Tests/CXXModules: test exporting modules which include headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9469
2024-04-30 10:10:34 -04:00
Ben Boeckel
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
Also add tests.

Fixes: #25828
2024-04-30 09:05:16 -04:00
Ben Boeckel
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name
C++ module support puts the export name in a filename. Export names with
`:` in them are not valid filenames on Windows. Add a method to escape
names as necessary.

See: #25828
2024-04-29 17:23:08 -04:00
Ben Boeckel
2041f7c9bf cmGeneratorTarget: add the original target as a COMPILE_ONLY link
Fixes: #25909
2024-04-26 20:15:05 -04:00
Brad King
d3190d6a73 CMake 3.29.2 2024-04-11 10:12:19 -04:00
Brad King
26e79ed299 Fix regression on reconfigure with unnormalized -DCMAKE_<LANG>_COMPILER=
Since commit 3f2a5971c0 (Modules: CMAKE_*_COMPILER convert path to cmake
path, 2023-12-02, v3.29.0-rc1~292^2) we normalize the path to the
compiler.  Update our logic that checks whether the compiler has changed
to account for path normalization.

Fixes: #25883
Issue: #25456
2024-04-10 12:03:17 -04:00
Evan Wilde
579472d877 Swift: Ninja: Remove module dependency for executables
We shouldn't include the swiftmodule in the ninja dependency graph
unless that target emits a swiftmodule.

Fixes: #25869
2024-04-08 18:07:13 -07:00
Brad King
a4774b0c10 CMake 3.29.1 2024-04-03 11:45:14 -04:00
Charlotte Koch
4c70e72cae cmSystemTools: Fix compilation on DragonFly BSD
Define `_XOPEN_SOURCE >= 700` to make `gettimeofday()` et al. available.
2024-04-02 17:33:02 -04:00
Brad King
85745cce7a ctest: Restore enforcement of RESOURCE_LOCK test property
Refactoring in commit 5ff0b4ed57 (cmCTestMultiProcessHandler:
Consolidate test readiness checks, 2023-10-20, v3.29.0-rc1~378^2~4)
accidentally broke `RESOURCE_LOCK`.  Fix it and replace the previous
test with one that would have caught this.

Fixes: #25843
2024-04-01 12:22:29 -04:00
Craig Scott
98cc86e265 try_compile(): Include languages with _ or - when passing linker vars
Fixes: #25809
2024-03-22 21:35:51 +11:00
Brad King
25d2850c19 CMake 3.29.0 2024-03-21 09:32:22 -04:00
Brad King
b5602e7254 CMake 3.28.4 2024-03-20 10:03:43 -04:00
Brad King
0287208bbf Merge topic 'ninja-fortran-include' into release-3.29
36dc8d6d50 Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9351
2024-03-20 09:55:47 -04:00
Brad King
36dc8d6d50 Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sources
If a preprocessed source also uses the Fortran `INCLUDE` directive,
search the original source file's directory.

Fixes: #25792
2024-03-19 07:56:13 -04:00
Brad King
788c204788 CMake 3.29.0-rc4 2024-03-14 13:33:17 -04:00
Brad King
e497fbfca3 Merge topic 'Apple-TBD-in-subdirecory' into release-3.29
bcc26ce465 Apple Text Based Stubs: should be usage in subdirectories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9341
2024-03-14 13:31:10 -04:00
Brad King
742af6cff7 Merge topic 'autogen-makefile-depfile' into release-3.29
d2d1763f88 cmQtAutoGenInitializer: De-duplicate autogen/timestamp target depend logic
6193d15556 Autogen: Restore target-ordering dependencies in Makefiles with DEPFILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9340
2024-03-14 11:46:53 -04:00
Brad King
8f0801cacc Merge topic 'LINKER_TYPE-mold-support' into release-3.29
801ae06952 LINKER_TYPE: Support MOLD only on GCC versions that support it
939ac5287e LINKER_TYPE: fix spelling error in message
922883782b LINKER_TYPE: Document that linker tool should be in the PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9334
2024-03-14 11:45:13 -04:00
Marc Chevrier
bcc26ce465 Apple Text Based Stubs: should be usage in subdirectories
Fixes: #25765
2024-03-14 14:33:48 +01:00
Brad King
d2d1763f88 cmQtAutoGenInitializer: De-duplicate autogen/timestamp target depend logic
We place the same target ordering dependencies on either the
`_autogen_timestamp_deps` target or the `_autogen` target.
Refactor the logic to avoid duplicating that code.
2024-03-14 09:18:56 -04:00
Brad King
6193d15556 Autogen: Restore target-ordering dependencies in Makefiles with DEPFILE
In commit aebfbcaa46 (AutoGen: Use depfiles for the XXX_autogen ninja
targets, 2020-01-14, v3.17.0-rc1~58^2) the `_autogen_timestamp_deps`
target was given target ordering dependencies through its custom command
rather than direct target dependencies as on the `_autogen` target.
Then commit 895fa3433f (cmQtAutoGenInitializer: support IMPLIB-only
imported targets, 2021-09-23, v3.22.0-rc1~80^2) converted some
target-level dependencies into file-level dependencies on the custom
command.  This only works with a monolithic build graph like Ninja.

Since commit ebc9e448b3 (Autogen: Add depfile support for Makefiles,
2023-09-07, v3.28.0-rc1~101^2~1) we use the `_autogen_timestamp_deps`
target in Makefile generators too.  This exposed the missing target
ordering dependency.

Fixes: #25766
2024-03-14 09:05:06 -04:00
Marc Chevrier
801ae06952 LINKER_TYPE: Support MOLD only on GCC versions that support it
Fixes: #25748
2024-03-13 11:13:21 -04:00
Brad King
3a739d4dcb EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gate
Some design concerns have been raised after trying the 3.29 release
candidates.  Avoid committing to a stable public interface for now.

Issue: #25767
2024-03-12 14:24:53 -04:00
Marc Chevrier
939ac5287e LINKER_TYPE: fix spelling error in message 2024-03-12 18:18:25 +01:00
Brad King
b1c4806914 install(EXPORT): Drop REQUIRED from exported find_dependency calls
In commit c6e6861e63 (install(EXPORT): Export find_dependency() calls,
2023-11-07, v3.29.0-rc1~439^2~1) we made the calls `REQUIRED`.  However,
a dependency is only required if the dependent package is required.
`find_dependency` already forwards the `REQUIRED` mark, and also already
marks the dependent package as not found if the dependency is missing.

Fixes: #25756
2024-03-11 12:07:32 -04:00
Brad King
04d8bc6bb9 Merge topic 'ctest-j-default' into release-3.29
5de1e21659 ctest: Allow passing -j without value to choose a contextual default
bbcbcff7d9 cmCTestMultiProcessHandler: Modernize member initialization
7457b474a1 Tests: Remove unnecessary parallel suppression from CTestCoverageCollectGCOV
ae69801d96 Tests: Convert CTestTestSkipReturnCode to RunCMake.ctest_test case
30dda49416 Tests: Convert CTestTestSerialOrder to RunCMake.ctest_test case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9315
2024-03-11 10:18:49 -04:00