summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_run/CrossCompile.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/try_run/CrossCompile.cmake')
-rw-r--r--Tests/RunCMake/try_run/CrossCompile.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_run/CrossCompile.cmake b/Tests/RunCMake/try_run/CrossCompile.cmake
new file mode 100644
index 0000000..4993768
--- /dev/null
+++ b/Tests/RunCMake/try_run/CrossCompile.cmake
@@ -0,0 +1,8 @@
+include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS})
+
+# Pretend we are cross-compiling to take that try_run code path.
+set(CMAKE_CROSSCOMPILING 1)
+set(RUN_RESULT 0)
+try_run(RUN_RESULT COMPILE_RESULT ${try_compile_bindir_or_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src.c)
+unset(CMAKE_CROSSCOMPILING)