-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (34 loc) · 1.42 KB
/
CMakeLists.txt
File metadata and controls
46 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Playing around with parallelizing std::partial_sum
# by Paul Dreik https://www.pauldreik.se/
# LICENSE: http://www.boost.org/LICENSE_1_0.txt
#this has only been tested on linux/gcc.
cmake_minimum_required(VERSION 2.8.7)
project(my_first_test)
enable_testing()
#SET(SANITIZEOPTS -fsanitize=address) #less then 2x slowdown
#SET(SANITIZEOPTS -fsanitize=thread) # approx 10x slowdown
#SET(SANITIZEOPTS -fsanitize=undefined)# approx 2x slowdown
#SET(PROFILEOPTS -pg)
#SET(FASTMATHOPTS -ffast-math)
#we need openmp to use gnu parallel stl
set(OPENMP -fopenmp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++14 -g ${PROFILEOPTS} ${SANITIZEOPTS} ${FASTMATHOPTS} ${OPENMP}")
#file(GLOB SRC "*.h" "*.cpp")
set(SRC main.cpp unittest_unsignedint.cpp)
# creates the executable
add_executable(test_executable ${SRC})
#a benchmark
add_executable(benchmark benchmark.cpp)
# indicates the include paths
#target_include_directories(test_executable PRIVATE ${BOOST_INCLUDE_DIRS})
#boost_unit_test_framework
find_package(Boost 1.50.0 COMPONENTS unit_test_framework)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
#target_link_libraries(test_exectutable ${Boost_LIBRARIES})
target_link_libraries(test_executable Boost::unit_test_framework)
endif()
target_link_libraries(test_executable pthread)
target_link_libraries(benchmark pthread)
# declares a test with our executable
add_test(NAME test1 COMMAND test_executable)