diff options
author | Minmin Gong <gongminmin@msn.com> | 2017-09-02 04:06:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-12 13:54:29 (GMT) |
commit | bc7c94fe13eeda2b59f5af606a03fdad5a9c29a5 (patch) | |
tree | 86395272041689ead3e1bc6f2a062cece8861cc5 /Modules/Platform | |
parent | 3f8c6cab4bb4a9f68708c11a38e4487dad363e38 (diff) | |
download | CMake-bc7c94fe13eeda2b59f5af606a03fdad5a9c29a5.zip CMake-bc7c94fe13eeda2b59f5af606a03fdad5a9c29a5.tar.gz CMake-bc7c94fe13eeda2b59f5af606a03fdad5a9c29a5.tar.bz2 |
MSVC: Add support for ARM64 architecture
Visual Studio 15.4 adds support for this architecture.
Fixes: #17213
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index cfe6e1c..f3f0fe2 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -122,7 +122,9 @@ set(CMAKE_BUILD_TYPE_INIT Debug) # Compute an architecture family from the architecture id. foreach(lang C CXX) set(_MSVC_${lang}_ARCHITECTURE_FAMILY "${MSVC_${lang}_ARCHITECTURE_ID}") - if(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM") + if(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM64") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM64") + elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM") set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM") elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^SH") set(_MSVC_${lang}_ARCHITECTURE_FAMILY "SHx") @@ -175,7 +177,7 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE) set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsApp.lib") elseif(WINDOWS_PHONE) set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib") - elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM") + elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib") else() set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") @@ -183,7 +185,7 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE) else() set(_PLATFORM_DEFINES "/DWIN32") - if(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM") + if(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib") elseif(MSVC_VERSION GREATER 1310) if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "(v[0-9]+_clang_.*|LLVM-vs[0-9]+.*)") @@ -215,6 +217,8 @@ set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") if(MSVC_C_ARCHITECTURE_ID) if(MSVC_C_ARCHITECTURE_ID MATCHES "^ARMV.I") set(_MACHINE_ARCH_FLAG "/machine:THUMB") + elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64") + set(_MACHINE_ARCH_FLAG "/machine:ARM64") elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM") set(_MACHINE_ARCH_FLAG "/machine:ARM") else() @@ -223,6 +227,8 @@ if(MSVC_C_ARCHITECTURE_ID) elseif(MSVC_CXX_ARCHITECTURE_ID) if(MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARMV.I") set(_MACHINE_ARCH_FLAG "/machine:THUMB") + elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64") + set(_MACHINE_ARCH_FLAG "/machine:ARM64") elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM") set(_MACHINE_ARCH_FLAG "/machine:ARM") else() |