-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (40 loc) · 1.23 KB
/
Copy pathCMakeLists.txt
File metadata and controls
51 lines (40 loc) · 1.23 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
cmake_minimum_required(VERSION 3.28)
project(MetaFlow CXX)
# CMake 3.28 does not know cxx_std_26 as a feature,
# so we keep the project-level standard at the highest CMake-recognised version.
# The per-target compile options below pass -std=c++26 explicitly to actually enable C++26 + reflection on g++-16.
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
find_package(Threads REQUIRED)
add_executable(MetaFlow-example
example/main.cpp
)
target_include_directories(MetaFlow-example PRIVATE
include
example
)
target_compile_options(MetaFlow-example PRIVATE
-freflection
-std=c++26
)
target_link_libraries(MetaFlow-example PRIVATE Threads::Threads)
add_executable(MetaFlow-benchmark
benchmark/main.cpp
)
target_include_directories(MetaFlow-benchmark PRIVATE
include
example
benchmark
)
target_compile_options(MetaFlow-benchmark PRIVATE
-freflection
-std=c++26
$<$<CONFIG:Release>:-march=native>
$<$<CONFIG:Release>:-O3>
$<$<CONFIG:Release>:-DNDEBUG>
)
target_link_libraries(MetaFlow-benchmark PRIVATE Threads::Threads)