summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-06-12 19:11:04 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-24 12:41:09 (GMT)
commit6051a49c78a36b82e77a62e09f0ba5a5b5d14532 (patch)
treeee9c31b9a8f5530bd0fa4a0c76ded239325f3c45 /Modules/CMakeDetermineCompilerId.cmake
parentbbcaf9689ea76d8deba13870dfc63f0654348b5a (diff)
downloadCMake-6051a49c78a36b82e77a62e09f0ba5a5b5d14532.zip
CMake-6051a49c78a36b82e77a62e09f0ba5a5b5d14532.tar.gz
CMake-6051a49c78a36b82e77a62e09f0ba5a5b5d14532.tar.bz2
Visual Studio: Add Android support
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake29
1 files changed, 25 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index df48fa5..ebfd5a4 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 "")