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 /Modules/CheckLanguage.cmake | |
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 'Modules/CheckLanguage.cmake')
-rw-r--r-- | Modules/CheckLanguage.cmake | 6 |
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 |