diff options
author | Brad King <brad.king@kitware.com> | 2020-10-19 14:28:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-19 14:28:58 (GMT) |
commit | c05e561474c422d23b9f1d29ccb5ceea0037477b (patch) | |
tree | c6bfa092139541628e1b61dd2d9bfe52cf4d6b32 /Modules | |
parent | 5f9d41b7e316a8eb97cbfbc9ea42e7ecc49fa409 (diff) | |
parent | bddc54a37d6d04cc574f9edfc49f941e69dd5379 (diff) | |
download | CMake-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.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 |