diff options
author | Patrick Gansterer <paroga@paroga.com> | 2013-09-25 03:20:22 (GMT) |
---|---|---|
committer | Patrick Gansterer <paroga@paroga.com> | 2013-09-25 03:20:22 (GMT) |
commit | 0b15ffc73b05c7ca82bfa904ba73112353851298 (patch) | |
tree | 933c06a136cf52501bf516c9c86796c841e9dfd6 /Modules | |
parent | faef6b4ec8141b0a3458a4c9af0136b77581ea71 (diff) | |
download | CMake-0b15ffc73b05c7ca82bfa904ba73112353851298.zip CMake-0b15ffc73b05c7ca82bfa904ba73112353851298.tar.gz CMake-0b15ffc73b05c7ca82bfa904ba73112353851298.tar.bz2 |
MSVC: Fix WinCE arch family preprocessor symbol (#14436)
In commit bd827f98 (Use COFF file header header for architecture
detection, 2013-08-05) the MSVC_<lang>_ARCHITECTURE_ID value computed by
CMakeDetermineCompilerId.cmake changed for WinCE architectures to be the
exact architecture read from the PE header. Fix platform preprocessor
definitions in Modules/Platform/Windows-MSVC.cmake to correspond to the
architecture family (ARM or SHx) instead of the specific architecture.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index d9881f2..7036ba0 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -124,8 +124,15 @@ endif() set(CMAKE_BUILD_TYPE_INIT Debug) if(WINCE) - string(TOUPPER "${MSVC_C_ARCHITECTURE_ID}" _MSVC_C_ARCHITECTURE_ID_UPPER) - string(TOUPPER "${MSVC_CXX_ARCHITECTURE_ID}" _MSVC_CXX_ARCHITECTURE_ID_UPPER) + foreach(lang C CXX) + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "${MSVC_${lang}_ARCHITECTURE_ID}") + if(_MSVC_${lang}_ARCHITECTURE_FAMILY STREQUAL "THUMB") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM") + elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^SH") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "SHx") + endif() + string(TOUPPER "${_MSVC_${lang}_ARCHITECTURE_FAMILY}" _MSVC_${lang}_ARCHITECTURE_FAMILY_UPPER) + endforeach() if("${CMAKE_SYSTEM_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)") math(EXPR _CE_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}") @@ -136,8 +143,8 @@ if(WINCE) endif() set(_PLATFORM_DEFINES "/D_WIN32_WCE=0x${_CE_VERSION} /DUNDER_CE") - set(_PLATFORM_DEFINES_C " /D${MSVC_C_ARCHITECTURE_ID} /D_${_MSVC_C_ARCHITECTURE_ID_UPPER}_") - set(_PLATFORM_DEFINES_CXX " /D${MSVC_CXX_ARCHITECTURE_ID} /D_${_MSVC_CXX_ARCHITECTURE_ID_UPPER}_") + set(_PLATFORM_DEFINES_C " /D${_MSVC_C_ARCHITECTURE_FAMILY} /D_${_MSVC_C_ARCHITECTURE_FAMILY_UPPER}_") + set(_PLATFORM_DEFINES_CXX " /D${_MSVC_CXX_ARCHITECTURE_FAMILY} /D_${_MSVC_CXX_ARCHITECTURE_FAMILY_UPPER}_") set(_RTC1 "") set(_FLAGS_CXX " /GR /EHsc") |