Skip to content

Commit

Permalink
Proper detection of Intel 64-bit architecture
Browse files Browse the repository at this point in the history
Size of pointer check was not enough
  • Loading branch information
alexey-lysiuk committed Apr 23, 2017
1 parent e38e1d6 commit 1c6cc3e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -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" )
Expand All @@ -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()

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c6cc3e

Please sign in to comment.