diff options
author | Brad King <brad.king@kitware.com> | 2017-11-28 12:50:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-28 12:57:58 (GMT) |
commit | acb4cb950023be9300699a0220715bebb50306ad (patch) | |
tree | 0632a156bc8bdfa03d75d81b7fbda4019096bcb1 /Modules/CMakeFindBinUtils.cmake | |
parent | 65f21a7eadc2144f0c85cd883cf63a6eb7681528 (diff) | |
download | CMake-acb4cb950023be9300699a0220715bebb50306ad.zip CMake-acb4cb950023be9300699a0220715bebb50306ad.tar.gz CMake-acb4cb950023be9300699a0220715bebb50306ad.tar.bz2 |
CMakeFindBinUtils: Improve switch between MSVC- and GNU-like tools
The switch was not considering some languages, such as `ASM`.
Instead of memorizing the list of languages in the condition,
use a language specified by the includer.
Fixes: #17510
Diffstat (limited to 'Modules/CMakeFindBinUtils.cmake')
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index e4103d0..ece0547 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -20,16 +20,9 @@ # on UNIX, cygwin and mingw # if it's the MS C/CXX compiler, search for link -if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC" - OR (CMAKE_HOST_WIN32 AND ( - "x${CMAKE_C_COMPILER_ID}" STREQUAL "xPGI" - OR "x${CMAKE_Fortran_COMPILER_ID}" STREQUAL "xPGI" - )) +if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" + OR "x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xMSVC" + OR (CMAKE_HOST_WIN32 AND "x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xPGI") OR (CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")) |