Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (41 loc) · 1.88 KB
/
Copy pathCMakeLists.txt
File metadata and controls
54 lines (41 loc) · 1.88 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
cmake_minimum_required(VERSION 3.31)
project(my_phlex_example VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.1")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15")
add_compile_options(-Wno-stringop-overflow)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "16")
add_compile_options(-Wno-array-bounds)
endif()
endif()
endif()
find_package(Boost REQUIRED json)
find_package(TBB REQUIRED)
find_package(spdlog REQUIRED)
find_package(phlex REQUIRED)
add_subdirectory(migration)
add_compile_options(-Wall -Wpedantic -Werror)
# Proxies for framework-agnostic experiment libraries
# N.B. The specified library type should be SHARED.
add_library(my_add SHARED my_add.cpp)
add_library(my_geometry SHARED my_geometry.cpp)
# Register providers for data products
add_library(numbers_source MODULE numbers_source.cpp)
target_link_libraries(numbers_source PRIVATE phlex::module)
add_library(geometry_source MODULE geometry_source.cpp)
target_link_libraries(geometry_source PRIVATE phlex::module my_geometry)
# Register experiment libraries with Phlex
add_library(add_and_verify MODULE add_and_verify.cpp)
target_link_libraries(add_and_verify PRIVATE phlex::module my_add my_geometry)
# Enable asserts for add_and_verify
# N.B. This should not be done for production code, but it is useful for testing and development.
target_compile_options(add_and_verify PRIVATE -UNDEBUG)
# Unfold example: vector<int> on parent layer -> int on child layer
add_library(vector_source MODULE vector_source.cpp)
target_link_libraries(vector_source PRIVATE phlex::module)
add_library(split_square_verify MODULE split_square_verify.cpp)
target_link_libraries(split_square_verify PRIVATE phlex::module)
# Enable asserts for split_square_verify
target_compile_options(split_square_verify PRIVATE -UNDEBUG)