-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (51 loc) · 1.69 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.23...3.27)
project(neosonar-neo-dev VERSION 0.1.0)
option(NEO_ENABLE_BENCHMARKS "Build benchmarks" ON)
option(NEO_ENABLE_TESTS "Build tests" ON)
option(NEO_ENABLE_TOOLS "Build tools" ON)
option(NEO_ENABLE_APPLE_ACCELERATE "Link against Apple Accelerate" ON)
option(NEO_ENABLE_INTEL_IPP "Link against Intel IPP" OFF)
option(NEO_ENABLE_INTEL_MKL "Link against Intel MKL" OFF)
option(NEO_ENABLE_XSIMD "Link against xsimd" ON)
find_program(CCACHE ccache)
if (CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif ()
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
enable_testing()
include(FetchContent)
FetchContent_Declare(mdspan GIT_REPOSITORY "https://github.com/kokkos/mdspan" GIT_TAG "stable" GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(mdspan)
if(NEO_ENABLE_INTEL_MKL)
set(MKL_LINK "static")
set(MKL_THREADING "sequential")
endif()
if(NEO_ENABLE_XSIMD)
FetchContent_Declare(xsimd GIT_REPOSITORY "https://github.com/xtensor-stack/xsimd" GIT_TAG "12.1.1" GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(xsimd)
endif()
add_subdirectory(src)
if(DEFINED SKBUILD)
add_subdirectory(extra/python)
return()
endif()
if(NEO_ENABLE_TESTS)
add_subdirectory(test)
endif()
if(NEO_ENABLE_BENCHMARKS)
add_subdirectory(extra/benchmark)
endif()
if(NEO_ENABLE_TOOLS)
add_subdirectory(extra/cli)
add_subdirectory(extra/plugin)
endif()