diff options
author | Samir Benmendil <me@rmz.io> | 2020-10-16 11:21:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-16 13:13:32 (GMT) |
commit | bddc54a37d6d04cc574f9edfc49f941e69dd5379 (patch) | |
tree | 226caf2f177b35b4540efc30c6df8550ef29f3d1 /Tests | |
parent | eee8fc40c9e2bd7c3b58fcb020356c42cb79eb81 (diff) | |
download | CMake-bddc54a37d6d04cc574f9edfc49f941e69dd5379.zip CMake-bddc54a37d6d04cc574f9edfc49f941e69dd5379.tar.gz CMake-bddc54a37d6d04cc574f9edfc49f941e69dd5379.tar.bz2 |
CheckLanguage: Pass CMAKE_TOOLCHAIN_FILE to test project
Fixes: #20545
Diffstat (limited to 'Tests')
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) |