Only require symbols to be defined in plugins

Core uses some unresolved symbols on Linux
develop
lethosor 2018-05-09 21:15:22 -04:00
parent 5b2cc7dc6e
commit 77ee74be50
2 changed files with 5 additions and 2 deletions

@ -217,8 +217,6 @@ if(APPLE)
set(CMAKE_MACOSX_RPATH 1) set(CMAKE_MACOSX_RPATH 1)
elseif(UNIX) elseif(UNIX)
add_definitions(-D_LINUX) add_definitions(-D_LINUX)
# Check for unresolved symbols at link time
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,defs")
elseif(WIN32) elseif(WIN32)
add_definitions(-DWIN32) add_definitions(-DWIN32)
endif() endif()

@ -6,6 +6,11 @@ IF(UNIX)
IF(DFHACK_BUILD_64) IF(DFHACK_BUILD_64)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -mno-avx") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -mno-avx")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -mno-avx") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -mno-avx")
IF(NOT APPLE)
# Linux: Check for unresolved symbols at link time
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,defs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,defs")
ENDIF()
ELSE() ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")