No need for pthread lib in examples and tests

This commit is contained in:
hvellyr 2016-06-07 10:29:45 +02:00
parent 45db14ebd7
commit e562f51f63
3 changed files with 8 additions and 4 deletions

View File

@ -56,6 +56,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(warning_options /W4 /wd4503 /wd4512)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(add_link_deps pthread)
endif()
enable_testing()
add_subdirectory(lint)

View File

@ -3,10 +3,10 @@ include_directories(..)
add_compile_options(${cxx11_options} ${warning_options})
add_executable(calc calc.cc)
target_link_libraries(calc pthread)
target_link_libraries(calc ${add_link_deps})
add_executable(calc2 calc2.cc)
target_link_libraries(calc2 pthread)
target_link_libraries(calc2 ${add_link_deps})
add_executable(calc3 calc3.cc)
target_link_libraries(calc3 pthread)
target_link_libraries(calc3 ${add_link_deps})

View File

@ -3,6 +3,6 @@ include_directories(..)
add_compile_options(${cxx11_options} ${warning_options})
add_executable(test-main test.cc)
target_link_libraries(test-main pthread)
target_link_libraries(test-main ${add_link_deps})
add_test(TestMain test-main)