summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-19 14:28:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-19 14:28:58 (GMT)
commitc05e561474c422d23b9f1d29ccb5ceea0037477b (patch)
treec6bfa092139541628e1b61dd2d9bfe52cf4d6b32 /Tests/RunCMake
parent5f9d41b7e316a8eb97cbfbc9ea42e7ecc49fa409 (diff)
parentbddc54a37d6d04cc574f9edfc49f941e69dd5379 (diff)
downloadCMake-c05e561474c422d23b9f1d29ccb5ceea0037477b.zip
CMake-c05e561474c422d23b9f1d29ccb5ceea0037477b.tar.gz
CMake-c05e561474c422d23b9f1d29ccb5ceea0037477b.tar.bz2
Merge topic 'checklanguage-honor-toolchain'
bddc54a37d CheckLanguage: Pass CMAKE_TOOLCHAIN_FILE to test project Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5384
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt1
-rw-r--r--Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake4
-rw-r--r--Tests/RunCMake/ToolchainFile/CheckLanguage.cmake2
-rw-r--r--Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake1
4 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt b/Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt
new file mode 100644
index 0000000..b96eee6
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt
@@ -0,0 +1 @@
+-- Looking for a C compiler - NOTFOUND
diff --git a/Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake
new file mode 100644
index 0000000..081f905
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake
@@ -0,0 +1,4 @@
+get_property(in_try_compile GLOBAL PROPERTY IN_TRY_COMPILE)
+if(in_try_compile)
+ message(FATAL_ERROR "Toolchain file included")
+endif()
diff --git a/Tests/RunCMake/ToolchainFile/CheckLanguage.cmake b/Tests/RunCMake/ToolchainFile/CheckLanguage.cmake
new file mode 100644
index 0000000..854b3d4
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CheckLanguage.cmake
@@ -0,0 +1,2 @@
+include(CheckLanguage)
+check_language(C)
diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
index 7eb4485..659523c 100644
--- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ endfunction()
run_cmake_toolchain(CallEnableLanguage)
run_cmake_toolchain(CallProject)
+run_cmake_toolchain(CheckLanguage)
run_cmake_toolchain(FlagsInit)
run_cmake_toolchain(LinkFlagsInit)