Skip to content

Commit

Permalink
Disable boost auto-link on Windows and have it always manually link (…
Browse files Browse the repository at this point in the history
…only).
  • Loading branch information
wrwilliams committed Oct 31, 2016
1 parent 5aabffb commit 72beb38
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
3 changes: 2 additions & 1 deletion cmake/shared.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set (DYNINST_PATCH_VERSION 0)
# Debugging
set(Boost_DEBUG 1)

add_definitions(-DBOOST_ALL_NO_LIB=1)
set (SOVERSION "${DYNINST_MAJOR_VERSION}.${DYNINST_MINOR_VERSION}")
set (LIBVERSION "${SOVERSION}.${DYNINST_PATCH_VERSION}")
set (DYNINST_VERSION "${LIBVERSION}")
Expand Down Expand Up @@ -173,4 +174,4 @@ endif()
# Just build vanilla versions, boost can handle it.
if (MSVC)
add_definitions(-DBOOST_NO_CXX11_VARIADIC_TEMPLATES)
endif()
endif()
11 changes: 4 additions & 7 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,18 @@ SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)

ADD_DEFINITIONS(-DCOMMON_LIB)

set (DEPS "")
if (IBERTY_FOUND)
set(DEPS "${DEPS};${IBERTY_LIBRARIES}")
set(DEPS ${IBERTY_LIBRARIES})
endif()

dyninst_library(common ${DEPS})
if (UNIX)
# Boost auto-links on Windows; don't double-link
target_link_private_libraries(common ${Boost_LIBRARIES})
endif()
list(APPEND DEPS ${Boost_LIBRARIES})

dyninst_library(common ${DEPS})
if(PLATFORM MATCHES nt OR PLATFORM MATCHES windows)
target_link_private_libraries(common Psapi WS2_32 dbghelp)
endif()


IF (USE_COTIRE)
cotire(common)
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion dyninstAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ endif ()

dyninst_library(dyninstAPI common instructionAPI stackwalk pcontrol patchAPI parseAPI symtabAPI)

target_link_private_libraries(dyninstAPI ${Boost_LIBRARIES})
if (UNIX)
# Boost auto-links on Windows; don't double-link
target_link_private_libraries(dyninstAPI ${Boost_LIBRARIES})
target_link_private_libraries (dyninstAPI pthread)
else()
target_link_private_libraries(dyninstAPI dbghelp WS2_32 imagehlp)
Expand Down
4 changes: 1 addition & 3 deletions instructionAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ ADD_DEFINITIONS(-DINSTRUCTION_LIB)

dyninst_library(instructionAPI common)

if(UNIX)
target_link_private_libraries(instructionAPI ${Boost_LIBRARIES})
endif()
target_link_private_libraries(instructionAPI ${Boost_LIBRARIES})

if (USE_COTIRE)
cotire(instructionAPI)
Expand Down
7 changes: 3 additions & 4 deletions parseAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,9 @@ endif()

dyninst_library(parseAPI common instructionAPI ${SYMREADER})

if (UNIX)
# Boost auto-links on Windows; don't double-link
target_link_private_libraries(parseAPI ${Boost_LIBRARIES})
elseif(WIN32)
target_link_private_libraries(parseAPI ${Boost_LIBRARIES})

if (WIN32)
target_link_private_libraries(parseAPI shlwapi)
endif()

Expand Down
2 changes: 1 addition & 1 deletion proccontrol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ set (DEPS common ${SYMREADER})
dyninst_library(pcontrol ${DEPS})

target_link_private_libraries(pcontrol ${CMAKE_DL_LIBS})
target_link_private_libraries(pcontrol ${Boost_LIBRARIES})

if (UNIX)
# Boost auto-links on Windows; don't double-link
target_link_private_libraries(pcontrol ${Boost_LIBRARIES})
target_link_private_libraries(pcontrol pthread)
endif()
if (USE_COTIRE)
Expand Down

0 comments on commit 72beb38

Please sign in to comment.