summaryrefslogtreecommitdiffstats
path: root/Modules
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 /Modules
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 'Modules')
-rw-r--r--Modules/CheckLanguage.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index 44387d4..928881c 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -68,6 +68,11 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
else()
set(_D_CMAKE_MAKE_PROGRAM "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}")
endif()
+ if(CMAKE_TOOLCHAIN_FILE)
+ set(_D_CMAKE_TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE}")
+ else()
+ set(_D_CMAKE_TOOLCHAIN_FILE "")
+ endif()
execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}
COMMAND ${CMAKE_COMMAND} . -G ${CMAKE_GENERATOR}
@@ -75,6 +80,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
-T "${CMAKE_GENERATOR_TOOLSET}"
${_D_CMAKE_GENERATOR_INSTANCE}
${_D_CMAKE_MAKE_PROGRAM}
+ ${_D_CMAKE_TOOLCHAIN_FILE}
OUTPUT_VARIABLE _cl_output
ERROR_VARIABLE _cl_output
RESULT_VARIABLE _cl_result