diff options
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 59dab6d..c1c9982 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -110,8 +110,15 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) else() set(_version "") endif() + if(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID) + set(_archid " ${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}") + else() + set(_archid "") + endif() message(STATUS "The ${lang} compiler identification is " - "${CMAKE_${lang}_COMPILER_ID}${_version}") + "${CMAKE_${lang}_COMPILER_ID}${_archid}${_version}") + unset(_archid) + unset(_version) else() message(STATUS "The ${lang} compiler identification is unknown") endif() @@ -431,10 +438,18 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} ) # Match the compiler location line printed out. set(ghs_toolpath "${CMAKE_MAKE_PROGRAM}") - string(REPLACE "/gbuild.exe" "/" ghs_toolpath ${ghs_toolpath}) - string(REPLACE / "\\\\" ghs_toolpath ${ghs_toolpath}) + if(CMAKE_HOST_UNIX) + string(REPLACE "/gbuild" "/" ghs_toolpath ${ghs_toolpath}) + else() + string(REPLACE "/gbuild.exe" "/" ghs_toolpath ${ghs_toolpath}) + string(REPLACE / "\\\\" ghs_toolpath ${ghs_toolpath}) + endif() if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "(${ghs_toolpath}[^ ]*)") - set(_comp "${CMAKE_MATCH_1}.exe") + if(CMAKE_HOST_UNIX) + set(_comp "${CMAKE_MATCH_1}") + else() + set(_comp "${CMAKE_MATCH_1}.exe") + endif() if(EXISTS "${_comp}") file(TO_CMAKE_PATH "${_comp}" _comp) set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) |