Commit Graph

63886 Commits

Author SHA1 Message Date
Ben Boeckel 2041f7c9bf cmGeneratorTarget: add the original target as a COMPILE_ONLY link
Fixes: #25909
2024-04-26 20:15:05 -04:00
Ben Boeckel 051c2110c8 Tests/CXXModules: test exporting modules which include headers
Test that headers that are part of the same target are available to
modules in the target itself.
2024-04-26 20:15:05 -04:00
Brad King b5602e7254 CMake 3.28.4 v3.28.4 2024-03-20 10:03:43 -04:00
Brad King 5969b4f457 Merge topic 'ninja-fortran-include' into release-3.28
36dc8d6d50 Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9351
2024-03-20 09:54:50 -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 8ebdee9314 Merge topic 'autogen-makefile-depfile' into release-3.28
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:08 -04: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
Brad King 7a9fc8ca06 Merge topic 'backport-3.28-ci-xcode-15.3' into release-3.28
8a6d05aa9d gitlab-ci: update macOS jobs to use Xcode 15.3
7bf893bc30 Tests: Update RunCMake.CheckCompilerFlag for Xcode 15.3
7f5f0ab4b3 Tests: Update RunCMake.CompileFeatures for Xcode 15.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9333
2024-03-13 10:52:15 -04:00
Brad King 8a6d05aa9d gitlab-ci: update macOS jobs to use Xcode 15.3 2024-03-12 09:29:45 -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 9bfb972c25 Merge topic 'cxxmodules-target-objects' into release-3.28
4ddf0453d5 Tests/CXXModules: add a test using `TARGET_OBJECTS` from modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9316
2024-03-08 09:32:01 -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 944f10d768 Merge topic 'cxxmodules-invalid-iterator' into release-3.28
844f054fe0 cmImportedCxxModuleInfo: remove unused pointer field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9303
2024-03-04 10:19:34 -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 d16ac6f801 Merge topic 'FindTIFF-cmake-package' into release-3.28
b6b2f73f36 FindTIFF: Fix name of upstream TIFF cmake package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9300
2024-03-01 08:59:04 -05:00
Brad King b6b2f73f36 FindTIFF: Fix name of upstream TIFF cmake package
Since commit 6a3059e66f (FindTIFF: bridge `tiff-config` into
FindTIFF-compatible interface, 2023-09-14, v3.28.0-rc1~87^2)
we try to find the upstream TIFF cmake package.  However, it
is called `TiffConfig.cmake`, not `tiff-config.cmake`, so we
need to match the capitalization of the package name.
2024-02-29 08:47:53 -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 6fa3cf4629 Merge topic 'test-cxxmodules-vs' into release-3.28
6925978f3e Tests/RunCMake/CXXModules: Update VS circular error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9299
2024-02-28 15:01:06 -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
Ben Boeckel 028f3134e5 cmExportFileGenerator: only export include paths for HEADERS file sets 2024-02-28 05:26:10 -05:00
Brad King febe479570 Merge topic 'cxxmodules-fileset-cache-fullpath' into release-3.28
0a18f9baad cmGeneratorTarget: collapse paths before querying the fileset cache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9286
2024-02-27 09:02:54 -05:00
Brad King 5feddb6f4b Merge topic 'clang-use-arg1' into release-3.28
7008fc234b CMakeDetermineCompilerId: use `_ARG1` to query the clang resource dir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9285
2024-02-27 09:02:27 -05:00
Ben Boeckel 7008fc234b CMakeDetermineCompilerId: use _ARG1 to query the clang resource dir
Other core queries do this, so do it here too.
2024-02-26 11:49:17 -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
Brad King e98cbbf65f Merge topic 'restore-link-interface-objlib-with-unity' into release-3.28
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>
Merge-request: !9279
2024-02-22 08:23:46 -05:00
Brad King 1371a28861 Merge topic 'cxxmodules-clang-resource-dir' into release-3.28
a3ada1a241 Clang: detect -resource-dir for clang-scan-deps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9274
2024-02-22 08:22:49 -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 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 edfdec287c Merge topic 'cxxmodules-transitive-modules-usage' into release-3.28
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>
Merge-request: !9273
2024-02-21 13:28:52 -05:00
Ben Boeckel a3ada1a241 Clang: detect -resource-dir for clang-scan-deps
When cross-compiling, `clang-scan-deps` needs help to find the correct
location of core headers such as `stddef.h`. Always determine this path
and pass it when available.

Fixes: #25590
2024-02-21 08:51:42 -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 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
Ben Boeckel a2e3e61a31 Tests/CXXModules: test transitive modules usage 2024-02-20 10:53:31 -05:00
Brad King 583641ac92 Merge topic 'cxxmodules-transitive-target-usage' into release-3.28
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>
Merge-request: !9265
2024-02-20 10:29:18 -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
Ben Boeckel d4a517f82a Tests/CXXModules: add a test with transitive targets 2024-02-19 10:25:27 -05:00
Brad King 00d908a01f Merge topic 'cxxmodules-nmc-duplicate-synthetic-targets' into release-3.28
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>
Merge-request: !9263
2024-02-19 09:23:58 -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
Ben Boeckel e0633a9517 Tests/CXXModules: add a test importing from a Ninja install
This ensures that consuming from a single configuration generator works
in all generators.

See: #25568
2024-02-16 11:09:56 -05:00
Ben Boeckel 150d7dbd68 Tests/CXXModules: support building a project with Ninja
This allows testing mixed generator setups.
2024-02-16 11:09:54 -05:00
Ben Boeckel e48e5e5506 Tests/CXXModules: document CMake_TEST_MODULE_COMPILATION items 2024-02-16 10:28:10 -05:00
Brad King fb0988a276 Merge topic 'cxxmodules-dyndep-error-on-private-usage' into release-3.28
3f8a59a05c cxxmodules: return failure from the collator when private usage is found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9257
2024-02-16 09:40:07 -05:00
Brad King d713896171 Merge topic 'cxxmodules-collation-restat' into release-3.28
a7424b636b Ninja: make the collator rule use `restat = 1`
e24eecfc33 Tests/CXXModules: add a test to ensure that `restat` works for collation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9259
2024-02-16 09:30:50 -05:00
Brad King d8fd8c2cb1 Merge topic 'cxxmodules-visibility-change-rebuild' into release-3.28
60a8736378 cmNinjaTargetGenerator: scanning depends on the module metadata
52036ce090 Tests/CXXModules: test that objects depend on dependent modules json files
9a45c9fbd5 cmNinjaTargetGenerator: use `emplace_back` for scanning deps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9247
2024-02-16 09:22:32 -05:00
Brad King 2808c49d82 Merge topic 'cxxmodules-depend-on-modmap-file' into release-3.28
363300ace5 cxxmodules: depend on the modmap contents
940628d48d Tests/CXXModules: test that objects depend on their modmap files
681ee92030 Tests/CXXModules: support testing rebuild conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9248
2024-02-16 09:20:09 -05:00
Brad King 148af75e86 Merge topic 'ci-test-CommandLength' into release-3.28
edb833d69e Tests/CommandLength: Refactor test commands to reduce test run time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9256
2024-02-16 09:17:14 -05:00