CrossCompiling: Load CMAKE_CROSSCOMPILING_EMULATOR from environment

Read `CMAKE_CROSSCOMPILING_EMULATOR` from an environment variable of the
same name if not specified with `-D` or an initial cache value.

Along with existing environment variable settings such as
`CMAKE_TOOLCHAIN_FILE`, cross compilation configuration can be more
completely set via environment variables.

Suggested-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Matt McCormick
2023-06-06 08:43:39 -04:00
committed by Brad King
parent ccb866448f
commit 7005dea005
8 changed files with 50 additions and 0 deletions
@@ -12,6 +12,10 @@ for the target system.
Lists>`, then the first value is the command and remaining values are its
arguments.
.. versionadded:: 3.28
This variable can be initialized via an
:envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable.
The command will be used to run :command:`try_run` generated executables,
which avoids manual population of the ``TryRunResults.cmake`` file.