Commit 1c31b42e authored by Kevin M. Godby's avatar Kevin M. Godby

Use CMake Threads package instead of manually specifying -pthread.

parent 33a18518
...@@ -32,16 +32,13 @@ else() ...@@ -32,16 +32,13 @@ else()
find_package(spdlog CONFIG REQUIRED) find_package(spdlog CONFIG REQUIRED)
endif() endif()
if (CMAKE_COMPILER_IS_GNUCXX) find_package(Threads)
set ( CMAKE_CXX_FLAGS "--std=c++11 -pthread")
set ( CMAKE_EXE_LIKKER_FLAGS "-pthread")
endif ()
add_executable(example example.cpp) add_executable(example example.cpp)
target_link_libraries(example spdlog::spdlog) target_link_libraries(example spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
add_executable(benchmark bench.cpp) add_executable(benchmark bench.cpp)
target_link_libraries(benchmark spdlog::spdlog) target_link_libraries(benchmark spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
enable_testing() enable_testing()
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment