Merge pull request #418 from Sonicadvance1/x86_32-cmake-removal

Add a Cmake generic build option and remove x86_32 build capabilities.
This commit is contained in:
shuffle2 2014-05-26 13:36:05 -07:00
commit e25c9fef46

View File

@ -11,6 +11,7 @@ option(USE_UPNP "Enables UPnP port mapping support" ON)
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)
option(ENABLE_PCH "Use PCH to speed up compilation" ON) option(ENABLE_PCH "Use PCH to speed up compilation" ON)
option(ENABLE_LTO "Enables Link Time Optimization" OFF) option(ENABLE_LTO "Enables Link Time Optimization" OFF)
option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)
option(OPENMP "Enable OpenMP parallelization" ON) option(OPENMP "Enable OpenMP parallelization" ON)
option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
@ -134,26 +135,24 @@ else()
add_definitions(-D_ARCH_32=1) add_definitions(-D_ARCH_32=1)
endif() endif()
if(NOT ENABLE_GENERIC)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR
${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_definitions(-msse2)
set(_M_X86 1)
add_definitions(-D_M_X86=1)
if(_ARCH_64) if(_ARCH_64)
set(_M_X86 1)
set(_M_X86_64 1) set(_M_X86_64 1)
add_definitions(-D_M_X86_64=1) add_definitions(-D_M_X86=1 -D_M_X86_64=1 -msse2)
else() else()
set(_M_X86_32 1) message(FATAL_ERROR "x86_32 is an unsupported platform. Enable generic build if you really want a JIT-less binary.")
add_definitions(-D_M_X86_32=1)
endif() endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm") elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
# This option only applies to 32bit ARM # This option only applies to 32bit ARM
set(_M_ARM 1) set(_M_ARM 1)
set(_M_ARM_32 1) set(_M_ARM_32 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_32=1) add_definitions(-D_M_ARM=1 -D_M_ARM_32=1)
set(_M_GENERIC 1) # ARMv7 isn't a generic build anymore, this shouldn't need to be defined
add_definitions(-D_M_GENERIC=1) set(ENABLE_GENERIC 1)
if(${ANDROID_NDK_ABI_NAME} MATCHES "armeabi-v7a") if(${ANDROID_NDK_ABI_NAME} MATCHES "armeabi-v7a")
add_definitions(-marm -march=armv7-a) add_definitions(-marm -march=armv7-a)
endif() endif()
@ -162,9 +161,13 @@ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
set(_M_ARM 1) set(_M_ARM 1)
set(_M_ARM_64 1) set(_M_ARM_64 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_64=1) add_definitions(-D_M_ARM=1 -D_M_ARM_64=1)
set(_M_GENERIC 1) set(ENABLE_GENERIC 1)
add_definitions(-D_M_GENERIC=1)
else() else()
set(ENABLE_GENERIC 1)
endif()
endif()
if(ENABLE_GENERIC)
message("Warning! Building generic build!") message("Warning! Building generic build!")
set(_M_GENERIC 1) set(_M_GENERIC 1)
add_definitions(-D_M_GENERIC=1) add_definitions(-D_M_GENERIC=1)