Fix possible link issue in OS X

This commit is contained in:
Eduardo Bart 2012-08-03 07:13:46 -03:00
parent 4954d5fecb
commit c218f915ba
2 changed files with 7 additions and 5 deletions

View File

@ -25,7 +25,7 @@ if(WIN32)
-i${CMAKE_CURRENT_SOURCE_DIR}/src/otcicon.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o)
SET(executable_SOURCES ${executable_SOURCES} otcicon.o)
endif(WIN32)
endif()
# add otclient executable
add_executable(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES})

View File

@ -153,7 +153,9 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
# process options
if(USE_STATIC_LIBS)
set(CMAKE_CXX_LINK_FLAGS "-static-libgcc -static-libstdc++")
if(NOT APPLE)
set(CMAKE_CXX_LINK_FLAGS "-static-libgcc -static-libstdc++")
endif()
message(STATUS "Link to static libraries: ON")
else()
message(STATUS "Link to static libraries: OFF")
@ -228,11 +230,11 @@ if(WIN32)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -D_WIN32_WINNT=0x0501)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DBOOST_THREAD_USE_LIB) # fix boost thread linkage
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,--large-address-aware") # strip all debug information
elseif(APPLE)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -D_REENTRANT) # enable thread safe code
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
if(NOT APPLE)
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -rdynamic") # rdynamic is needed by backtrace.h used in crash handler
endif()
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -rdynamic") # rdynamic is needed by backtrace.h used in crash handler
set(framework_LIBRARIES ${framework_LIBRARIES} dl)
endif()