Merge pull request #229 from godbyk/cmake-example-improvements
Use CMake Threads package instead of manually specifying -pthread.
This commit is contained in:
commit
43511559a8
@ -32,16 +32,13 @@ else()
|
||||
find_package(spdlog CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set ( CMAKE_CXX_FLAGS "--std=c++11 -pthread")
|
||||
set ( CMAKE_EXE_LIKKER_FLAGS "-pthread")
|
||||
endif ()
|
||||
find_package(Threads)
|
||||
|
||||
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)
|
||||
target_link_libraries(benchmark spdlog::spdlog)
|
||||
target_link_libraries(benchmark spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
enable_testing()
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||
|
Loading…
Reference in New Issue
Block a user