Permalink
Browse files

boost 1.50: link chrono if available to fix mingw linking issues

  • Loading branch information...
1 parent 3b3fe3f commit 5869285d4abaacc5ceb201720e69be2e5ac76f86 jK committed Sep 29, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 CMakeLists.txt
  2. +4 −0 rts/builds/dedicated/CMakeLists.txt
  3. +4 −0 rts/lib/headlessStubs/CMakeLists.txt
View
@@ -205,6 +205,7 @@ if (MINGW)
endif (MINGW)
FIND_PACKAGE(Boost 1.35.0 COMPONENTS thread regex program_options system signals REQUIRED)
+FIND_PACKAGE(Boost 1.35.0 COMPONENTS chrono)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
# Note the missing REQUIRED, as headless & dedi may not depend on those.
@@ -22,6 +22,10 @@ SET(ENGINE_SRC_ROOT_DIR "${CMAKE_SOURCE_DIR}/rts")
LIST(APPEND engineDedicatedLibraries ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY})
LIST(APPEND engineDedicatedLibraries 7zip ${SPRING_MINIZIP_LIBRARY} ${ZLIB_LIBRARY} lua)
LIST(APPEND engineDedicatedLibraries headlessStubs)
+if (MINGW AND Boost_CHRONO_FOUND)
+ # in newer boost versions the thread library depends on it
+ LIST(APPEND engineDedicatedLibraries ${Boost_CHRONO_LIBRARY})
+endif (MINGW AND Boost_CHRONO_FOUND)
IF (UNIX)
# Needed for dynamically loading shared libraries (on some OS)
LIST(APPEND engineDedicatedLibraries dl)
@@ -21,5 +21,9 @@ ENDIF (MINGW)
ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources})
TARGET_LINK_LIBRARIES(headlessStubs ${Boost_THREAD_LIBRARY})
+IF (MINGW AND Boost_CHRONO_FOUND)
+ # in newer boost versions the thread library depends on it
+ TARGET_LINK_LIBRARIES(headlessStubs ${Boost_CHRONO_LIBRARY})
+ENDIF (MINGW AND Boost_CHRONO_FOUND)
SET_TARGET_PROPERTIES(headlessStubs PROPERTIES COMPILE_FLAGS "${PIC_FLAG}")

0 comments on commit 5869285

Please sign in to comment.