Skip to content

Commit

Permalink
Tell cmake to use dynamic libs for Boost
Browse files Browse the repository at this point in the history
conda-forge boost recipe is configured to prefer static libs for some reason.

in 1.70, the cmake files don't let you force use of dynamic libs unless BUILD_SHARED_LIBS is
set and that will cause add_library() to build libsparta as shared. ugh

Looks like this has been fixed in 1.71 (logic doesn't use BUILD_SHARED_LIBS anymore).
  • Loading branch information
timsnyder committed Mar 7, 2020
1 parent 2ce725d commit bce2d83
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sparta/cmake/sparta-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ if (APPLE)
set (CMAKE_CXX_COMPILER_VERSION 10.0)
find_package (Boost 1.49.0 REQUIRED HINTS /usr/local/Cellar/boost/* COMPONENTS ${_BOOST_COMPONENTS})
else ()
set (Boost_USE_STATIC_LIBS OFF)

# BOOST_CMAKE logic for asking for the shared libraries is broken, you can only force it to use
# them if you're building shared libs? wtf?
set (existing_build_shared ${BUILD_SHARED_LIBS})
set (BUILD_SHARED_LIBS ON)

find_package (Boost 1.49.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS})
set (BUILD_SHARED_LIBS ${existing_build_shared})

endif ()
message ("-- Using BOOST ${Boost_VERSION_STRING}")

Expand Down

0 comments on commit bce2d83

Please sign in to comment.