Set CXXFLAGS properly to ensure compatibility with i686 systems.

develop
Petr Mrázek 2011-11-06 21:16:16 +01:00
parent 46f55c1577
commit 2c27119d85
2 changed files with 15 additions and 8 deletions

@ -56,6 +56,18 @@ SET(DFHACK_DEVDOC_DESTINATION hack)
OPTION(BUILD_LIBRARY "Build the library that goes into DF." ON)
OPTION(BUILD_PLUGINS "Build the plugins." ON)
## flags for GCC
# default to hidden symbols
# build 32bit
# ensure compatibility with older CPUs
# enable C++11 features
IF(UNIX)
add_definitions(-DLINUX_BUILD)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32 -march=i686 -std=c++0x")
SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32 -march=i686")
ENDIF()
#add depends to include path
INCLUDE_DIRECTORIES ( library/depends )

@ -133,15 +133,10 @@ IF(UNIX)
ENDIF()
IF(UNIX)
add_definitions(-DLINUX_BUILD)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32 -std=c++0x")
SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32")
SET(PROJECT_LIBS rt )
ELSE()
IF(MSVC)
SET(PROJECT_LIBS psapi ${dfhack_SOURCE_DIR}/library/depends/ntdll/ntdll.lib)
ENDIF()
ELSE(WIN32)
#FIXME: do we really need this?
SET(PROJECT_LIBS psapi ${dfhack_SOURCE_DIR}/library/depends/ntdll/ntdll.lib)
ENDIF()
ADD_LIBRARY(dfhack SHARED ${PROJECT_SRCS})