diff options
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 44332a66a8..832b18de06 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -248,7 +248,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_PostBuildEvent_Command "") if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$") set(id_cl_var "ClangClExecutable") - elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg][Cc][Ll]$") + elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])") set(id_cl "$(CLToolExe)") elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*") set(id_cl clang.exe) @@ -310,17 +310,36 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_PreferredToolArchitecture "") endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") + set(id_keyword "Win32Proj") set(id_system "<ApplicationType>Windows Phone</ApplicationType>") elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(id_keyword "Win32Proj") set(id_system "<ApplicationType>Windows Store</ApplicationType>") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(id_keyword "Android") + set(id_system "<ApplicationType>Android</ApplicationType>") else() + set(id_keyword "Win32Proj") set(id_system "") endif() - if(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)") + if(id_keyword STREQUAL "Android") + if(CMAKE_GENERATOR MATCHES "Visual Studio 14") + set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>") + elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]") + set(id_system_version "<ApplicationTypeRevision>3.0</ApplicationTypeRevision>") + else() + set(id_system_version "") + endif() + elseif(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)") set(id_system_version "<ApplicationTypeRevision>${CMAKE_MATCH_1}</ApplicationTypeRevision>") else() set(id_system_version "") endif() + if(id_keyword STREQUAL "Android") + set(id_config_type "DynamicLibrary") + else() + set(id_config_type "Application") + endif() if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION) set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>") endif() @@ -333,9 +352,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}</${CMAKE_MATCH_1}>\n ") endif() endforeach() - if(id_platform STREQUAL ARM64) + if(id_keyword STREQUAL "Android") + set(id_WindowsSDKDesktopARMSupport "") + elseif(id_platform STREQUAL "ARM64") set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>") - elseif(id_platform STREQUAL ARM) + elseif(id_platform STREQUAL "ARM") set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>") else() set(id_WindowsSDKDesktopARMSupport "") @@ -702,7 +723,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) # The IAR-AVR compiler uses a binary format that places a '6' # character (0x34) before each character in the string. Strip - # out these characters without removing any legitamate characters. + # out these characters without removing any legitimate characters. if("${info}" MATCHES "(.)I.N.F.O.:.") string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}") endif() |