diff options
author | Brad King <brad.king@kitware.com> | 2013-10-08 14:58:56 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-08 14:58:56 (GMT) |
commit | 5a6c15155cbf18de60e118700e3e778f796e213d (patch) | |
tree | edcf132f41e1dbf93627d78518d06c0536e03aaa /Modules/CMakeDetermineCompilerId.cmake | |
parent | f8241136b42c7e1064ca8764c6fa5e17012127da (diff) | |
parent | 3d8356d486ae736d1ba151aedfeb928222e7a084 (diff) | |
download | CMake-5a6c15155cbf18de60e118700e3e778f796e213d.zip CMake-5a6c15155cbf18de60e118700e3e778f796e213d.tar.gz CMake-5a6c15155cbf18de60e118700e3e778f796e213d.tar.bz2 |
Merge topic 'clang-cl-compiler'
3d8356d Clang: Support Windows variants for GNU and MSVC (#13035, #14458)
51ab85c CMakeDetermineCompilerId: Add notion of "simulated" id/version
be10826 CMakeDetermineCompilerId: Fix local var init
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index da955cb..de4a882 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -80,6 +80,8 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) + set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) endfunction() #----------------------------------------------------------------------------- @@ -309,9 +311,12 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(COMPILER_ID) set(COMPILER_VERSION) set(PLATFORM_ID) + set(ARCHITECTURE_ID) + set(SIMULATE_ID) + set(SIMULATE_VERSION) file(STRINGS ${file} - CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:") - set(HAVE_COMPILER_TWICE 0) + CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 6 REGEX "INFO:") + set(COMPILER_ID_TWICE) foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") if(COMPILER_ID) @@ -333,6 +338,14 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") endif() + if("${info}" MATCHES ".*INFO:simulate\\[([^]\"]*)\\].*") + set(SIMULATE_ID "${CMAKE_MATCH_1}") + endif() + if("${info}" MATCHES ".*INFO:simulate_version\\[([^]\"]*)\\].*") + set(SIMULATE_VERSION "${CMAKE_MATCH_1}") + string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${SIMULATE_VERSION}") + string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}") + endif() endforeach() # Detect the exact architecture from the PE header. @@ -370,6 +383,8 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}") set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}") + set(CMAKE_${lang}_SIMULATE_ID "${SIMULATE_ID}") + set(CMAKE_${lang}_SIMULATE_VERSION "${SIMULATE_VERSION}") endif() # Check the compiler identification string. @@ -418,6 +433,8 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) + set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) endfunction() |