Commit Graph

35306 Commits

Author SHA1 Message Date
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
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
Brad King
da334e2db9 Merge topic 'ctest-tests-from-file' into release-3.29
170ec48601 Help: Improve ctest tests-from-file documentation wording and wrapping
1a4837641e ctest: Remove unnecessary and ambiguous tests-from-file comment syntax
d52c66bfb3 ctest: Honor tests-from-file options with empty input
8673264e25 Tests: Make ctest tests-from-file expected output more precise

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9322
2024-03-11 10:16:59 -04:00
Brad King
5de1e21659 ctest: Allow passing -j without value to choose a contextual default
Under job server integration, added by commit 80fe56c481 (ctest: Add
support for running under a make job server on POSIX systems,
2023-11-15, v3.29.0-rc1~324^2), use a very high default so that
parallelism is effectively limited only by available job server tokens.

Otherwise, choose a default limit based on the number of processors.

Also allow passing `0` to specify unbounded parallelism.

Fixes: #25739
2024-03-10 11:41:39 -04:00
Adrian Pop
c51f84b96a GET_RUNTIME_DEPENDENCIES: Allow more whitespace before objdump's "DLL Name:"
LLVM's `llvm-objdump` has spaces before "DLL Name:" instead of tabs.
2024-03-10 11:03:21 -04:00
Brad King
bbcbcff7d9 cmCTestMultiProcessHandler: Modernize member initialization 2024-03-10 10:27:05 -04:00
Brad King
1a4837641e ctest: Remove unnecessary and ambiguous tests-from-file comment syntax
Test names can contain `#`.  Since we ignore lines that do not match any
test names anyway, "commenting" can still work without explicit syntax.
Also drop whitespace trimming for similar reasons.

Fixes: #25741
2024-03-08 16:25:33 -05:00
Brad King
d52c66bfb3 ctest: Honor tests-from-file options with empty input
If the `--tests-from-file` input file is empty, no tests should run.
2024-03-08 16:06:35 -05:00
Brad King
ca0a9def2e ctest: Exit with failure when tests-from-file input is missing
If the options added by

* commit 022f20f663 (ctest: add command line option to run the tests listed
                     in a given file, 2023-11-29, v3.29.0-rc1~66^2~2)
* commit dbacc1d5a8 (ctest: add command line option to exclude tests listed
                     in a given file, 2023-11-30, v3.29.0-rc1~66^2~1)
* commit 701029726f (ctest_test: add options INCLUDE_FROM_FILE and
                     EXCLUDE_FROM_FILE, 2023-12-03, v3.29.0-rc1~66^2)

are given a missing file, fail instead of ignoring it.

Fixes: #25740
2024-03-06 16:14:04 -05:00
Brad King
965acca98c CMake 3.29.0-rc3 2024-03-04 13:58:26 -05:00
Brad King
37ddb04738 Merge topic 'cxxmodules-invalid-iterator' into release-3.29
844f054fe0 cmImportedCxxModuleInfo: remove unused pointer field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9303
2024-03-04 10:20:47 -05:00
Ben Boeckel
844f054fe0 cmImportedCxxModuleInfo: remove unused pointer field
Also avoids usage of an invalid `importit` when module names are not
available.
2024-03-01 11:23:44 -05:00
Brad King
65bd837786 Merge branch 'backport-3.28-cxxmodules-no-export-basedirs-as-include-paths' 2024-02-28 09:20:15 -05:00
Ben Boeckel
028f3134e5 cmExportFileGenerator: only export include paths for HEADERS file sets 2024-02-28 05:26:10 -05:00
Brad King
4ff4417b54 Merge topic 'cxxmodules-fileset-cache-fullpath' into release-3.29
0a18f9baad cmGeneratorTarget: collapse paths before querying the fileset cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9286
2024-02-27 09:06:24 -05:00
Ben Boeckel
0a18f9baad cmGeneratorTarget: collapse paths before querying the fileset cache
Observed with paths with `../` when outside of the source tree. I
attempted to reproduce a test suite case for it but could not make it
happen.
2024-02-24 17:17:39 -05:00
Evan Wilde
f292e28b84 Swift: Ninja: Pass module name to all swift builds
Executables that don't export a public API should not emit a
swiftmodule, but the swift modulename is observable from within the
program, so we should still set the module name on executable builds.

Fixes: #25710
2024-02-23 11:12:05 -05:00
Brad King
dc45b20aca CMake 3.29.0-rc2 2024-02-22 09:40:22 -05:00
Brad King
312d0ccb6b Merge topic 'restore-link-interface-objlib-with-unity' into release-3.29
5b8e9e068f Restore support for TARGET_OBJECTS in link interfaces with unity builds
1313c78a9c Tests: Update RunCMake.TargetObjects cmake_minimum_required version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9279
2024-02-22 08:26:11 -05:00
Brad King
5b8e9e068f Restore support for TARGET_OBJECTS in link interfaces with unity builds
This was broken by commit df08c37a42 (cmGlobalGenerator: Add unity/pch
sources after computing compile features, 2024-02-02, v3.28.3~1^2~1^2),
and 3.28.2's commit 76b5383123 (cmGlobalGenerator: add unity sources
after computing target compile features, 2024-01-01, v3.28.2~17^2~1).

The problem is very similar to that fixed by commit 4e8f24e977 (PCH:
Clear link interface cache when adding PCH object to it, 2022-01-24,
v3.23.0-rc1~44^2~9).  Generalize that fix.

Fixes: #25696
2024-02-21 17:08:57 -05:00
Brad King
c66396699b Merge topic 'cxxmodules-transitive-modules-usage' into release-3.29
ec348ee4b9 cmGeneratorTarget: discover synthetic targets recursively
67466ddf65 cmExportFileGenerator: export link libraries as-is
a2e3e61a31 Tests/CXXModules: test transitive modules usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9273
2024-02-21 13:34:34 -05:00
Ben Boeckel
ec348ee4b9 cmGeneratorTarget: discover synthetic targets recursively
Fixes: #25288
2024-02-20 10:53:31 -05:00
Ben Boeckel
67466ddf65 cmExportFileGenerator: export link libraries as-is
This allows for transitive modules to work because
`$<COMPILE_ONLY>`-wrapped dependencies do not end up in the
`linked-target-dirs` collator property. Test suite exported property
tests updated to account for the change.
2024-02-20 10:53:31 -05:00
Brad King
d2df2e94e5 Merge topic 'vs-17.10' into release-3.29
d256581bb0 VS: Fix '-T version=14.40' under VS 17.10 preview 1
3a7fbd04c8 VS: Verify toolset version= field format more strictly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9271
2024-02-20 10:36:00 -05:00
Brad King
dcdbdd82d5 Merge topic 'cxxmodules-transitive-target-usage' into release-3.29
8b6fc81fc3 cmTarget: copy link libraries from the right properties
d4a517f82a Tests/CXXModules: add a test with transitive targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9265
2024-02-20 10:30:25 -05:00
Brad King
d256581bb0 VS: Fix '-T version=14.40' under VS 17.10 preview 1
VS 17.10 preview 1 comes with toolset `v143` version `14.40`.  This is
the first time that the first three digits of the version do not match
the toolset name.  Add a special case to map version `14.40` back to
toolset `v143`.
2024-02-20 06:23:34 -05:00
Brad King
3a7fbd04c8 VS: Verify toolset version= field format more strictly
In commit 5f13168419 (VS: Add option to select the version of the
toolset used by VS 2017, 2018-05-19, v3.12.0-rc1~38^2) we added logic to
verify that the toolset version, such as `14.35`, matches the toolset
name, such as `v143`.  Clarify the logic to not construct a temporary
nonsensical toolset name like `v1435`.  Also verify the format of the
toolset version more strictly, e.g., to reject `14.350` earlier.
Previously the latter example was only rejected by the `.props` file not
existing.
2024-02-19 12:06:48 -05:00
Ben Boeckel
8b6fc81fc3 cmTarget: copy link libraries from the right properties
This fixes transitive dependencies' usage requirements not appearing
when compiling synthetic targets.

See: https://discourse.cmake.org/t/9819
2024-02-19 10:25:29 -05:00
Brad King
f18ba02d7e Merge topic 'cxxmodules-nmc-duplicate-synthetic-targets' into release-3.29
5261af9424 cmGeneratorTarget: store synthetic targets in its cache
e0633a9517 Tests/CXXModules: add a test importing from a `Ninja` install
150d7dbd68 Tests/CXXModules: support building a project with `Ninja`
e48e5e5506 Tests/CXXModules: document `CMake_TEST_MODULE_COMPILATION` items

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9263
2024-02-19 09:23:21 -05:00
Ben Boeckel
5261af9424 cmGeneratorTarget: store synthetic targets in its cache
The synthetic target cache was never actually updated, so record them in
the cache so that reuses can actually be discovered.

Fixes: #25568
2024-02-16 11:09:56 -05:00