diff options
author | Gunnar Roth <gunnar.roth@gmx.de> | 2015-02-13 15:14:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-24 14:33:08 (GMT) |
commit | 3d612c735285d9a63d4981a2ca7bff44cd741e4b (patch) | |
tree | b728de5b267babb6f48c679ee7e91c599a4cf63f | |
parent | 886dcaa7c5f91269b91da857d6eb2db3610d385e (diff) | |
download | CMake-3d612c735285d9a63d4981a2ca7bff44cd741e4b.zip CMake-3d612c735285d9a63d4981a2ca7bff44cd741e4b.tar.gz CMake-3d612c735285d9a63d4981a2ca7bff44cd741e4b.tar.bz2 |
MSVC: Compile with arch-specific flags on ARM platforms (#14552)
Define the exact ARM architecture name as a preprocessor symbol.
Compile with /QRarch4T or /QRarch5T on ARMV4I or ARMV5I.
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 6df377b..267de3c 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -159,7 +159,18 @@ if(WINCE) set(_PLATFORM_DEFINES_CXX " /D${_MSVC_CXX_ARCHITECTURE_FAMILY} /D_${_MSVC_CXX_ARCHITECTURE_FAMILY_UPPER}_") set(_RTC1 "") + set(_FLAGS_C "") set(_FLAGS_CXX " /GR /EHsc") + + foreach(lang C CXX) + if(_MSVC_${lang}_ARCHITECTURE_FAMILY STREQUAL "ARM") + set(_PLATFORM_DEFINES_${lang} "${_PLATFORM_DEFINES_${lang}} /D${MSVC_${lang}_ARCHITECTURE_ID}") + if(MSVC_${lang}_ARCHITECTURE_ID MATCHES "^ARMV([45])I$") + set(_FLAGS_${lang} "${_FLAGS_${lang}} /QRarch${CMAKE_MATCH_1}T") + endif() + endif() + endforeach() + set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib") set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib") |