Skip to content

Commit

Permalink
find_package(THREADS REQUIRED), etc
Browse files Browse the repository at this point in the history
Background:
```
/home/travis/build/headupinclouds/hunter/examples/spdlog/foo.cpp:(.text._ZN6spdlog7details16async_log_helperC2ESt10shared_ptrINS_9formatterEERKSt6vectorIS2_INS_5sinks4sinkEESaIS8_EEmSt8functionIFvRKSsEENS_21async_overflow_policyERKSD_IFvvEERKNSt6chrono8durationIlSt5ratioILl1ELl1000EEEESM_[_ZN6spdlog7details16async_log_helperC2ESt10shared_ptrINS_9formatterEERKSt6vectorIS2_INS_5sinks4sinkEESaIS8_EEmSt8functionIFvRKSsEENS_21async_overflow_policyERKSD_IFvvEERKNSt6chrono8durationIlSt5ratioILl1ELl1000EEEESM_]+0x200): undefined reference to `pthread_create'
```
  • Loading branch information
headupinclouds committed May 2, 2018
1 parent 8dbfe14 commit 37f2e46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ find_package(fmt CONFIG REQUIRED)
target_link_libraries(spdlog INTERFACE fmt::fmt)
target_compile_definitions(spdlog INTERFACE SPDLOG_FMT_EXTERNAL=1)

### threads ###
find_package(Threads REQUIRED)
target_link_libraries(spdlog INTERFACE Threads::Threads)

option(SPDLOG_BUILD_EXAMPLES "Build examples" OFF)
option(SPDLOG_BUILD_TESTS "Build tests" OFF)

Expand Down
1 change: 1 addition & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if(@ANDROID@)
endif()

find_package(fmt REQUIRED)
find_package(Threads REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")

0 comments on commit 37f2e46

Please sign in to comment.