From 2c27119d85fa1db25dd3a5fe4abf04fd3fbc4a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 6 Nov 2011 21:16:16 +0100 Subject: [PATCH] Set CXXFLAGS properly to ensure compatibility with i686 systems. --- CMakeLists.txt | 12 ++++++++++++ library/CMakeLists.txt | 11 +++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63914d774..fd73f8580 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 70f216eb2..3be6a1975 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -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})