Skip to content

Commit

Permalink
Merge pull request #1265 from MikaelSmith/FACT-1338
Browse files Browse the repository at this point in the history
(FACT-1338) Resolve weird pthread dependencies
  • Loading branch information
peterhuene committed Feb 2, 2016
2 parents a6f1818 + 00be8c3 commit 2f120b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ include(options)

# We use program_options, system, filesystem, date_time, and regex directly.
find_package(Boost 1.54 REQUIRED COMPONENTS program_options system filesystem date_time regex)
# date_time and regex need threads on some platforms, and find_package Boost only includes
# pthreads if you require the Boost.Thread component.
find_package(Threads)

find_package(Ruby 1.9)

Expand Down
7 changes: 6 additions & 1 deletion exe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ include_directories(
)

add_executable(facter ${FACTER_SOURCES})
target_link_libraries(facter libfacter ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LEATHERMAN_UTIL_LIB} ${LEATHERMAN_NOWIDE_LIB})
target_link_libraries(facter libfacter
${Boost_PROGRAM_OPTIONS_LIBRARY}
${LEATHERMAN_UTIL_LIB}
${LEATHERMAN_NOWIDE_LIB}
${CMAKE_THREAD_LIBS_INIT} # fix until Leatherman switches to private dependencies
)

leatherman_install(facter)
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ target_link_libraries(libfacter PRIVATE
${OPENSSL_LIBRARIES}
${YAMLCPP_LIBRARIES}
${CURL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)

symbol_exports(libfacter "${CMAKE_CURRENT_LIST_DIR}/inc/facter/export.h")
Expand Down
1 change: 1 addition & 0 deletions lib/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ target_link_libraries(libfacter_test
${OPENSSL_LIBRARIES}
${LEATHERMAN_LIBRARIES}
${CURL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)

# Generate a file containing the path to the fixtures
Expand Down

0 comments on commit 2f120b3

Please sign in to comment.