mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 01:49:23 -05:00
try_run: Use CMAKE_CROSSCOMPILING_EMULATOR.
If the CMAKE_CROSSCOMPILING_EMULATOR variable is defined, and CMAKE_CROSSCOMPILING is TRUE, then use CMAKE_CROSSCOMPILING_EMULATOR to run the try_run executables. This prevents the need to populate TryRunResults.cmake when cross compiling.
This commit is contained in:
committed by
Brad King
parent
579c4bec6e
commit
e942526b3d
@@ -73,7 +73,8 @@ When cross compiling, the executable compiled in the first step
|
||||
usually cannot be run on the build host. The ``try_run`` command checks
|
||||
the :variable:`CMAKE_CROSSCOMPILING` variable to detect whether CMake is in
|
||||
cross-compiling mode. If that is the case, it will still try to compile
|
||||
the executable, but it will not try to run the executable. Instead it
|
||||
the executable, but it will not try to run the executable unless the
|
||||
:variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable is set. Instead it
|
||||
will create cache variables which must be filled by the user or by
|
||||
presetting them in some CMake script file to the values the executable
|
||||
would have produced if it had been run on its actual target platform.
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
CMAKE_CROSSCOMPILING_EMULATOR
|
||||
-----------------------------
|
||||
|
||||
Default value for the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property of
|
||||
executables. See that target property for additional information.
|
||||
This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It
|
||||
should point to a command on the host system that can run executable built
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user