Commit Graph

11089 Commits

Author SHA1 Message Date
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 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 85d6d3b2e3 generate_apple_*_selection_file: Add option to capture errors
Add an option to capture error messages in a variable instead of
terminating with a fatal error.

Fixes: #25778
2024-03-19 09:52:32 -04:00
Brad King 2149dbd379 generate_apple_architecture_selection_file: Document $(ARCHS_STANDARD) support
Also add a test case.

Fixes: #25780
2024-03-19 09:52:32 -04:00
Brad King be642f6ed5 generate_apple_architecture_selection_file: Simplify signature
Allow callers to pass multiple values to list-valued arguments
instead of putting the entire list in a single quoted argument.

Fixes: #25779
2024-03-19 09:52:32 -04:00
Brad King 8959ad9db1 Tests/RunCMake/CMakePackage: Fix Apple architecture selection argument order
Call `generate_apple_architecture_selection_file` with matching order in
`SINGLE_ARCHITECTURES` and `SINGLE_ARCHITECTURE_INCLUDE_FILES`.
2024-03-19 09:51:21 -04:00
Brad King 677f3d721b Tests/RunCMake/CMakePackage: Add architecture i386 for macOS on Xcode < 10
Use every architecture each version of Xcode has in `$(ARCHS_STANDARD)`.
2024-03-19 09:46:57 -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 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 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 886333da38 Merge topic 'export-find_dependency-calls' into release-3.29
3a739d4dcb EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gate

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9336
2024-03-13 10:57:07 -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
Brad King 682767e8a5 Merge branch 'backport-3.28-ci-xcode-15.3' 2024-03-12 09:49:17 -04:00
Brad King 7bf893bc30 Tests: Update RunCMake.CheckCompilerFlag for Xcode 15.3
Xcode passes a new `-use-frontend-parseable-output` flag to Swift that
conflicts with our `-parseable-output` flag.  Use a different flag for
the test case.
2024-03-12 09:29:45 -04:00
Brad King 7f5f0ab4b3 Tests: Update RunCMake.CompileFeatures for Xcode 15.3
Xcode no longer puts an extra backslash in its `-std=` flags.
2024-03-12 09:29:29 -04: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 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
Brad King 7457b474a1 Tests: Remove unnecessary parallel suppression from CTestCoverageCollectGCOV
This hasn't been necessary since commit ab7eda2591 (Tests: Remove
unnecessary pass regex on CTestCoverageCollectGCOV, 2020-04-29,
v3.18.0-rc1~239^2~2).
2024-03-10 10:27:02 -04:00
Brad King ae69801d96 Tests: Convert CTestTestSkipReturnCode to RunCMake.ctest_test case 2024-03-10 10:26:14 -04:00
Brad King 30dda49416 Tests: Convert CTestTestSerialOrder to RunCMake.ctest_test case 2024-03-10 10:24:50 -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 8673264e25 Tests: Make ctest tests-from-file expected output more precise 2024-03-08 16:03:48 -05:00
Brad King 74d3765c2d Merge topic 'cxxmodules-target-objects' into release-3.29
4ddf0453d5 Tests/CXXModules: add a test using `TARGET_OBJECTS` from modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9316
2024-03-08 09:32:36 -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 60433fc6e8 Tests: Generalize ctest tests-from-file test cases 2024-03-06 13:34:10 -05:00
Ben Boeckel 4ddf0453d5 Tests/CXXModules: add a test using TARGET_OBJECTS from modules
See: #25732
2024-03-06 12:34:46 -05:00
Brad King cb2dc012c0 Merge topic 'cxxmodules-no-export-basedirs-as-include-paths' into release-3.29
65bd837786 Merge branch 'backport-3.28-cxxmodules-no-export-basedirs-as-include-paths'
028f3134e5 cmExportFileGenerator: only export include paths for HEADERS file sets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9295
2024-02-29 08:02:28 -05:00
Brad King 81a8cf2410 Merge topic 'cxxmodules-no-export-basedirs-as-include-paths' into release-3.28
028f3134e5 cmExportFileGenerator: only export include paths for HEADERS file sets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9295
2024-02-29 08:01:22 -05:00
Brad King 7f2275c65d Merge topic 'test-cxxmodules-vs' into release-3.29
6925978f3e Tests/RunCMake/CXXModules: Update VS circular error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9299
2024-02-28 15:01:36 -05:00
Brad King 6925978f3e Tests/RunCMake/CXXModules: Update VS circular error message
Match the message expected from MSBuild as of VS 17.9.
2024-02-28 14:16:20 -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
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 63600a8ca6 Merge topic 'test-BuildDepends-no-rosetta' into release-3.29
6b8c99a1e3 Tests: Fix BuildDepends on macOS arm64 without rosetta

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9277
2024-02-22 08:27:23 -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 1313c78a9c Tests: Update RunCMake.TargetObjects cmake_minimum_required version
This was missed in commit 1edf138506 (Tests/RunCMake: Update
cmake_minimum_required versions, 2023-02-06, v3.27.0-rc1~508^2~1).
2024-02-21 16:22:35 -05:00
Brad King 74957cacf8 Merge topic 'cxxmodules-transitive-std' into release-3.29
f0df692d21 Tests/CXXModules: test `cxx_std_20` coming from a dependency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9276
2024-02-21 13:37:43 -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
Brad King 0d3f35f495 Merge topic 'cxxmodules-transitive-std' into release-3.28
f0df692d21 Tests/CXXModules: test `cxx_std_20` coming from a dependency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9276
2024-02-21 13:29:36 -05:00
Brad King 6b8c99a1e3 Tests: Fix BuildDepends on macOS arm64 without rosetta 2024-02-21 08:39:37 -05:00
Ben Boeckel f0df692d21 Tests/CXXModules: test cxx_std_20 coming from a dependency
Closes: #25569
2024-02-20 12:32:48 -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
Ben Boeckel a2e3e61a31 Tests/CXXModules: test transitive modules usage 2024-02-20 10:53:31 -05:00