Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #418 from Sonicadvance1/x86_32-cmake-removal
Add a Cmake generic build option and remove x86_32 build capabilities.
  • Loading branch information
shuffle2 committed May 26, 2014
2 parents 4758b36 + 28e643c commit e25c9fe
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ option(USE_UPNP "Enables UPnP port mapping support" ON)
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)
option(ENABLE_PCH "Use PCH to speed up compilation" ON)
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(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON)
Expand Down Expand Up @@ -134,37 +135,39 @@ else()
add_definitions(-D_ARCH_32=1)
endif()

if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR
${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_definitions(-msse2)
set(_M_X86 1)
add_definitions(-D_M_X86=1)
if(_ARCH_64)
set(_M_X86_64 1)
add_definitions(-D_M_X86_64=1)
if(NOT ENABLE_GENERIC)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR
${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(_ARCH_64)
set(_M_X86 1)
set(_M_X86_64 1)
add_definitions(-D_M_X86=1 -D_M_X86_64=1 -msse2)
else()
message(FATAL_ERROR "x86_32 is an unsupported platform. Enable generic build if you really want a JIT-less binary.")
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
# This option only applies to 32bit ARM
set(_M_ARM 1)
set(_M_ARM_32 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_32=1)
# ARMv7 isn't a generic build anymore, this shouldn't need to be defined
set(ENABLE_GENERIC 1)
if(${ANDROID_NDK_ABI_NAME} MATCHES "armeabi-v7a")
add_definitions(-marm -march=armv7-a)
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
# This option only applies to 64bit ARM
set(_M_ARM 1)
set(_M_ARM_64 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_64=1)
set(ENABLE_GENERIC 1)
else()
set(_M_X86_32 1)
add_definitions(-D_M_X86_32=1)
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
# This option only applies to 32bit ARM
set(_M_ARM 1)
set(_M_ARM_32 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_32=1)
set(_M_GENERIC 1)
add_definitions(-D_M_GENERIC=1)
if(${ANDROID_NDK_ABI_NAME} MATCHES "armeabi-v7a")
add_definitions(-marm -march=armv7-a)
set(ENABLE_GENERIC 1)
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
# This option only applies to 64bit ARM
set(_M_ARM 1)
set(_M_ARM_64 1)
add_definitions(-D_M_ARM=1 -D_M_ARM_64=1)
set(_M_GENERIC 1)
add_definitions(-D_M_GENERIC=1)
else()
endif()

if(ENABLE_GENERIC)
message("Warning! Building generic build!")
set(_M_GENERIC 1)
add_definitions(-D_M_GENERIC=1)
Expand Down

0 comments on commit e25c9fe

Please sign in to comment.