summaryrefslogtreecommitdiffstats
path: root/Tests/TryCompile/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/TryCompile/CMakeLists.txt')
-rw-r--r--Tests/TryCompile/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index cca19bc..9396cfa 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -89,6 +89,12 @@ if(SHOULD_FAIL_DUE_TO_EMPTY_SOURCE)
message(SEND_ERROR "Trying to compile an empty source succeeded?")
endif()
+# try to compile a copied source
+try_compile(SHOULD_PASS
+ SOURCE_FROM_FILE pass.c ${TryCompile_SOURCE_DIR}/pass.c
+ OUTPUT_VARIABLE TRY_OUT)
+EXPECT_COMPILED("SOURCE_FROM_FILE" SHOULD_PASS "${TRY_OUT}")
+
# try to run a source specified directly
set(TRY_RUN_MAIN_CODE
"extern int answer(); \n"