try_compile: Propagating top level includes into whole-project calls

Fixes: #24151
This commit is contained in:
Craig Scott
2024-05-18 18:48:00 +10:00
parent ff12b19786
commit 4cb5bb014d
14 changed files with 187 additions and 5 deletions
+5
View File
@@ -271,6 +271,11 @@ Dependency Providers
:command:`project`. Calling ``cmake_language(SET_DEPENDENCY_PROVIDER)``
outside of that context will result in an error.
.. versionadded:: 3.30
The :prop_gbl:`PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE` global
property can be set if the dependency provider also wants to be enabled
in whole-project calls to :command:`try_compile`.
.. note::
The choice of dependency provider should always be under the user's control.
As a convenience, a project may choose to provide a file that users can
+11
View File
@@ -47,6 +47,11 @@ below for the meaning of other options.
:ref:`configure-log try_compile event <try_compile configure-log event>`
if the ``NO_LOG`` option is not specified.
.. versionadded:: 3.30
If the :prop_gbl:`PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE` global
property is set to true, :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` is
propagated into the project's build configuration.
This command supports an alternate signature for CMake older than 3.25.
The signature above is recommended for clarity.
@@ -388,6 +393,12 @@ configuration:
:variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` to specify the MSVC debug
information format.
.. versionadded:: 3.30
If the :prop_gbl:`PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE` global
property is set to true, :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` is
propagated into the test project's build configuration when using the
:ref:`whole-project signature <Try Compiling Whole Projects>`.
See Also
^^^^^^^^