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.
This commit is contained in:
Gunnar Roth 2015-02-13 10:14:34 -05:00 committed by Brad King
parent 886dcaa7c5
commit 3d612c7352
1 changed files with 11 additions and 0 deletions

View File

@ -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")