From 3d612c735285d9a63d4981a2ca7bff44cd741e4b Mon Sep 17 00:00:00 2001 From: Gunnar Roth Date: Fri, 13 Feb 2015 10:14:34 -0500 Subject: 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. --- Modules/Platform/Windows-MSVC.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) 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") -- cgit v0.12