File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
project (ThreadPool )
2
2
cmake_minimum_required (VERSION 3.1 )
3
3
4
- set (CMAKE_CXX_STANDARD 11 )
5
-
6
4
include_directories (include )
7
- add_definitions (-Wall -Wextra -pedantic )
5
+
6
+ set (WARNING_FLAGS -Wall -Wextra -pedantic )
7
+
8
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" )
9
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14" )
10
+ endif ()
8
11
9
12
add_library (ThreadPool SHARED src/ThreadPool.cc )
13
+ target_compile_options (ThreadPool PUBLIC ${WARNING_FLAGS} )
14
+ set_target_properties (ThreadPool PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED True )
15
+
10
16
install (TARGETS ThreadPool LIBRARY DESTINATION lib )
11
17
install (FILES include /ThreadPool.hh DESTINATION include )
12
18
13
19
add_executable (test_ThreadPool test /test_ParallelMap.cc test /catch_main.cc )
14
20
target_link_libraries (test_ThreadPool ThreadPool )
21
+ target_compile_options (test_ThreadPool PUBLIC ${WARNING_FLAGS} )
22
+ set_target_properties (test_ThreadPool PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED True )
You can’t perform that action at this time.
0 commit comments