-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
executable file
·138 lines (107 loc) · 3.75 KB
/
CMakeLists.txt
File metadata and controls
executable file
·138 lines (107 loc) · 3.75 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
cmake_minimum_required(VERSION 3.28)
project(
pot
VERSION 0.0.1
DESCRIPTION "Parallel Operations Toolkit"
LANGUAGES CXX
)
get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY)
option(POT_BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(POT_BUILD_TESTS "Enable unit testing" ON )
option(POT_CHECK_WARNINGS "Strict compiler checks" ON )
# set(CMAKE_CXX_STANDARD 23)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_CXX_EXTENSIONS OFF)
add_compile_definitions(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
# Apply compiler flags
include(${CMAKE_CURRENT_LIST_DIR}/cmake/CompilerFlags.cmake)
apply_compiler_flags()
set(POT_HEADERS
include/${PROJECT_NAME}/simd/simd_traits.h
include/${PROJECT_NAME}/simd/simd_auto.h
include/${PROJECT_NAME}/simd/simd_forced.h
include/${PROJECT_NAME}/sync/sync_object.h
include/${PROJECT_NAME}/sync/async_lock.h
include/${PROJECT_NAME}/traits/pot_traits.h
include/${PROJECT_NAME}/traits/compare.h
include/${PROJECT_NAME}/traits/guards.h
include/${PROJECT_NAME}/utils/time_it.h
include/${PROJECT_NAME}/utils/platform.h
include/${PROJECT_NAME}/utils/this_thread.h
include/${PROJECT_NAME}/utils/cache_line.h
include/${PROJECT_NAME}/utils/unique_function.h
include/${PROJECT_NAME}/executors/executor.h
include/${PROJECT_NAME}/executors/inline_executor.h
include/${PROJECT_NAME}/executors/thread_executor.h
include/${PROJECT_NAME}/executors/thread_pool_executor.h
include/${PROJECT_NAME}/coroutines/task.h
include/${PROJECT_NAME}/coroutines/async_condition_variable.h
include/${PROJECT_NAME}/coroutines/when_all.h
include/${PROJECT_NAME}/coroutines/async_barrier.h
include/${PROJECT_NAME}/coroutines/resume_on.h
include/${PROJECT_NAME}/algorithms/parfor.h
include/${PROJECT_NAME}/algorithms/lfqueue.h
include/${PROJECT_NAME}/algorithms/lfdequeue.h
include/${PROJECT_NAME}/algorithms/reduce.h
include/${PROJECT_NAME}/algorithms/dot.h
include/${PROJECT_NAME}/algorithms/parsections.h
include/${PROJECT_NAME}/threads/thread.h
include/${PROJECT_NAME}/memory/coro_memory.h
include/${PROJECT_NAME}/pot.h
)
set(POT_SOURCES
src/utils/this_thread.cpp
# src/executors/inline_executor.cpp
# src/executors/thread_executor.cpp
)
add_library(${PROJECT_NAME}
${POT_HEADERS}
${POT_SOURCES}
)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
set_target_properties(
${PROJECT_NAME}
PROPERTIES
#CXX_STANDARD 20
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
LINKER_LANGUAGE CXX
)
target_compile_features(pot PUBLIC cxx_std_23)
# Apply warning flags
if(COMMAND apply_warning_flags_to_targets)
apply_warning_flags_to_targets(pot)
endif()
target_include_directories(${PROJECT_NAME}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
# Installation
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}
)
include(FetchContent)
FetchContent_Declare(
concurrencpp
GIT_REPOSITORY https://github.com/David-Haim/concurrencpp.git
GIT_TAG master )
FetchContent_MakeAvailable(concurrencpp)
include(FetchContent)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 10.2.1 )
FetchContent_MakeAvailable(fmt)
find_package(OpenMP REQUIRED)
if(OpenMP_CXX_FOUND)
target_link_libraries(pot PRIVATE OpenMP::OpenMP_CXX)
endif()
# Testing
if(POT_BUILD_TESTS AND CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
enable_testing()
add_subdirectory(test)
endif()