diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 58a7e44d0..0e5f75837 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,6 +13,7 @@ include( CheckIncludeFile ) include( CheckIncludeFiles ) include( CheckLibraryExists ) include( FindPkgConfig ) +include( TargetArch ) if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) option( NO_STRIP "Do not strip Release or MinSizeRel builds" ) @@ -32,7 +33,9 @@ if( APPLE ) option( OSX_COCOA_BACKEND "Use native Cocoa backend instead of SDL" ON ) endif() -if( CMAKE_SIZEOF_VOID_P MATCHES "8" ) +target_architecture(ZDOOM_TARGET_ARCH) + +if( ${ZDOOM_TARGET_ARCH} MATCHES "x86_64" ) set( X64 64 ) endif() @@ -347,6 +350,11 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) endif () endif () + if( NOT X64 AND NOT CAN_DO_MFPMATH ) + set( CMAKE_C_FLAGS "-DNO_SSE ${CMAKE_CXX_FLAGS}" ) + set( CMAKE_CXX_FLAGS "-DNO_SSE ${CMAKE_CXX_FLAGS}" ) + endif() + # Use the highest C++ standard available since VS2015 compiles with C++14 # but we only require C++11. The recommended way to do this in CMake is to # probably to use target_compile_features, but I don't feel like maintaining