summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-27 14:06:42 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-28 12:36:14 (GMT)
commit6007f7ca01b84ee70ffe49ae5a8bb41763116024 (patch)
tree03663de1ed91dc9d9685710e5abdf12d5322f719 /Modules/CMakeDetermineCompilerId.cmake
parent332771c942c25c0e60de136091fe77ac761e1965 (diff)
downloadCMake-6007f7ca01b84ee70ffe49ae5a8bb41763116024.zip
CMake-6007f7ca01b84ee70ffe49ae5a8bb41763116024.tar.gz
CMake-6007f7ca01b84ee70ffe49ae5a8bb41763116024.tar.bz2
CMakeDetermineCompilerId: Always use compiler detected from IDE
When compiler id detection also provides a CMAKE_<LANG>_COMPILER value, use it unconditionally. It is known to be the compiler that is actually in use by IDE builds in VS and Xcode. Do not let a stray cache entry try to say otherwise.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake10
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 6fccb16..762d4ae 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -67,12 +67,10 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
# Check if compiler id detection gave us the compiler tool.
- if(NOT CMAKE_${lang}_COMPILER)
- if(CMAKE_${lang}_COMPILER_ID_TOOL)
- set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}" PARENT_SCOPE)
- else()
- set(CMAKE_${lang}_COMPILER "CMAKE_${lang}_COMPILER-NOTFOUND" PARENT_SCOPE)
- endif()
+ if(CMAKE_${lang}_COMPILER_ID_TOOL)
+ set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}" PARENT_SCOPE)
+ elseif(NOT CMAKE_${lang}_COMPILER)
+ set(CMAKE_${lang}_COMPILER "CMAKE_${lang}_COMPILER-NOTFOUND" PARENT_SCOPE)
endif()
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)