Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR

Evaluate generator expressions in these properties, as they apply to
`add_test`, `add_custom_command`, and `add_custom_target`.

The `CMAKE_CROSSCOMPILING_EMULATOR` variable's `try_run` behavior occurs
at configure time and so cannot support generator expressions.
This commit is contained in:
Brad King
2024-01-26 15:16:46 -05:00
parent b9ad73fcb2
commit 13ece67a58
23 changed files with 162 additions and 59 deletions
@@ -13,6 +13,10 @@ for built target system executables.
Lists>`, then the first value is the command and remaining values are its
arguments.
.. versionadded:: 3.29
Contents of ``CROSSCOMPILING_EMULATOR`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
This property is initialized by the value of the
:variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable if it is set when a target
is created.
+3
View File
@@ -15,6 +15,9 @@ If this property contains a :ref:`semicolon-separated list <CMake Language
Lists>`, then the first value is the command and remaining values are its
arguments.
Contents of ``TEST_LAUNCHER`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
This property is initialized by the value of the
:variable:`CMAKE_TEST_LAUNCHER` variable if it is set when a target
is created.
+3
View File
@@ -9,3 +9,6 @@ cmake-test-launcher
* The :command:`add_test` command now honors
:variable:`CMAKE_CROSSCOMPILING_EMULATOR` only when cross-compiling.
See policy :policy:`CMP0158`.
* The :prop_tgt:`CROSSCOMPILING_EMULATOR` target property now
supports :manual:`generator expressions <cmake-generator-expressions(7)>`.
@@ -19,5 +19,8 @@ for the target system.
The command will be used to run :command:`try_run` generated executables,
which avoids manual population of the ``TryRunResults.cmake`` file.
It is also used as the default value for the
:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables.
This variable is also used as the default value for the
:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables. However,
while :manual:`generator expressions <cmake-generator-expressions(7)>` are
supported by the target property (since CMake 3.29), they are *not* supported
by this variable's :command:`try_run` functionality.
+5 -5
View File
@@ -3,14 +3,14 @@ CMAKE_TEST_LAUNCHER
.. versionadded:: 3.29
This variable is used to specify a launcher for running tests, added
by the :command:`add_test` command, that run an executable target.
This variable is used to initialize the :prop_tgt:`TEST_LAUNCHER` target
property of executable targets as they are created. It is used to specify
a launcher for running tests, added by the :command:`add_test` command,
that run an executable target.
If this variable contains a :ref:`semicolon-separated list <CMake Language
Lists>`, then the first value is the command and remaining values are its
arguments.
This variable can be initialized via an
:envvar:`CMAKE_TEST_LAUNCHER` environment variable.
It is also used as the default value for the
:prop_tgt:`TEST_LAUNCHER` target property of executables.