-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
52 lines (39 loc) · 1.25 KB
/
CMakeLists.txt
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
47
48
49
50
51
52
# VecCore Benchmarks
find_package(benchmark REQUIRED)
# Avoid deprecation warning from Vc
if(NOT MSVC)
add_compile_options(-Wno-deprecated-declarations)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# prevent ICC from issuing streaming stores,
# which obfuscate the timings for benchmarks
add_compile_options(-qopt-streaming-stores=never)
endif()
add_executable(mathbench math_benchmarks.cc)
target_link_libraries(mathbench
benchmark::benchmark benchmark::benchmark_main VecCore)
if(BUILD_TESTING)
add_test(NAME bench-math COMMAND mathbench)
endif()
add_executable(quadratic quadratic.cc)
target_link_libraries(quadratic VecCore)
add_executable(nbody nbody.cc)
target_link_libraries(nbody VecCore)
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(GD IMPORTED_TARGET gdlib)
endif()
add_library(png STATIC png.cc)
if (GD_FOUND)
target_compile_definitions(png PUBLIC HAVE_GD)
target_link_libraries(png PUBLIC PkgConfig::GD)
endif()
foreach(target julia mandelbrot newton)
add_executable(${target} ${target}.cc)
target_link_libraries(${target} png VecCore)
endforeach()
if(BUILD_TESTING)
foreach(target julia mandelbrot newton quadratic nbody)
add_test(NAME bench-${target} COMMAND ${target})
endforeach()
endif()