summaryrefslogtreecommitdiffstats
path: root/Tests/TryCompile
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-30 18:50:25 (GMT)
committerMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-30 18:50:25 (GMT)
commit0f28653ba9dea36564dbd41388536982c56a96eb (patch)
treef1655de6a7ed6c16a41eec3eb918a42ab9f9f006 /Tests/TryCompile
parentcadcb6a5f0e1ebaefd74f8c52151e410c57cfa96 (diff)
downloadCMake-0f28653ba9dea36564dbd41388536982c56a96eb.zip
CMake-0f28653ba9dea36564dbd41388536982c56a96eb.tar.gz
CMake-0f28653ba9dea36564dbd41388536982c56a96eb.tar.bz2
try_compile: Rename SOURCE_FROM_ARG -> SOURCE_FROM_CONTENT
Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT (which we can do because it was recently added and hasn't been in a release yet). The new name should be clearer as to what it does, and also more consistent with the CONTENT arguments to some other commands. Also, fix a typo in an error message.
Diffstat (limited to 'Tests/TryCompile')
-rw-r--r--Tests/TryCompile/CMakeLists.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 9396cfa..5f540e9 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -78,7 +78,7 @@ include(old_and_new_signature_tests.cmake)
# try to compile an empty source specified directly
try_compile(SHOULD_FAIL_DUE_TO_EMPTY_SOURCE
- SOURCE_FROM_ARG empty.c "")
+ SOURCE_FROM_CONTENT empty.c "")
if(SHOULD_FAIL_DUE_TO_EMPTY_SOURCE)
message(SEND_ERROR "Trying to compile an empty source succeeded?")
endif()
@@ -103,11 +103,11 @@ set(TRY_RUN_EXT_CODE
"int answer() { return 42; }\n")
try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
- SOURCE_FROM_ARG main.c "${TRY_RUN_MAIN_CODE}"
- SOURCE_FROM_ARG answer.c "${TRY_RUN_EXT_CODE}"
+ SOURCE_FROM_CONTENT main.c "${TRY_RUN_MAIN_CODE}"
+ SOURCE_FROM_CONTENT answer.c "${TRY_RUN_EXT_CODE}"
COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT)
-EXPECT_COMPILED("SOURCE_FROM_ARG" SHOULD_COMPILE "${COMPILE_OUTPUT}")
-EXPECT_RUN_RESULT("SOURCE_FROM_ARG" SHOULD_EXIT_WITH_ERROR 42)
+EXPECT_COMPILED("SOURCE_FROM_CONTENT" SHOULD_COMPILE "${COMPILE_OUTPUT}")
+EXPECT_RUN_RESULT("SOURCE_FROM_CONTENT" SHOULD_EXIT_WITH_ERROR 42)
try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
SOURCE_FROM_VAR main.c TRY_RUN_MAIN_CODE