-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (65 loc) · 1.55 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
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 3.28.0)
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
project(AdventOfCode2024 CXX)
option(DEBUG Off)
if(DEBUG)
set(CMAKE_BUILD_TYPE Debug)
add_compile_options(-fsanitize=address -g)
add_link_options(-fsanitize=address -g)
else()
set(CMAKE_BUILD_TYPE Release)
endif()
include(cmake/CPM.cmake)
CPMAddPackage(
NAME ctre
GITHUB_REPOSITORY hanickadot/compile-time-regular-expressions
GIT_TAG v3.9.0
)
CPMAddPackage(
NAME unordered_dense
GITHUB_REPOSITORY martinus/unordered_dense
GIT_TAG v4.5.0
)
CPMAddPackage(
NAME thread-pool
GITHUB_REPOSITORY willkill07/thread-pool
GIT_TAG 779cc0e4b92f7c32a89501c85f716b036d0b2668
OPTIONS
"TP_BUILD_TESTS OFF"
"TP_BUILD_BENCHMARKS OFF"
"TP_BUILD_EXAMPLES OFF"
)
CPMAddPackage(
NAME Catch2
GITHUB_REPOSITORY catchorg/Catch2
GIT_TAG v3.7.1
OPTIONS
"CATCH_INSTALL_DOCS OFF"
"CATCH_INSTALL_EXTRAS OFF"
"CATCH_ENABLE_REPRODUCIBLE_BUILD"
"CATCH_BUILD_TESTING OFF"
"CATCH_BUILD_EXAMPLES OFF"
"CATCH_BUILD_EXTRA_TESTS OFF"
)
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras)
add_compile_options(
-Wall
-Wextra
-Wpedantic
-Wconversion
-Wuninitialized
-Wshadow
-march=native
$<$<CXX_COMPILER_ID:GNU>:-Wnrvo>)
add_executable(AdventOfCode2024)
add_executable(AdventOfCode2024Tests)
add_executable(AdventOfCode2024Benchmarks)
add_library(Advent)
enable_testing()
include(CTest)
include(Catch)
catch_discover_tests(AdventOfCode2024Tests)
add_subdirectory(src)