NOT-OMEGA commited on
Commit
2d7267d
Β·
verified Β·
1 Parent(s): 7b3b19b

Upload CMakeLists.txt

Browse files
Files changed (1) hide show
  1. CMakeLists.txt +65 -0
CMakeLists.txt ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 3.16)
2
+ project(collabdocs VERSION 1.0 LANGUAGES CXX)
3
+
4
+ set(CMAKE_CXX_STANDARD 17)
5
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
6
+ set(CMAKE_CXX_EXTENSIONS OFF)
7
+
8
+ # Release build optimizations
9
+ if(NOT CMAKE_BUILD_TYPE)
10
+ set(CMAKE_BUILD_TYPE Release)
11
+ endif()
12
+
13
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
14
+
15
+ # ─── Find dependencies ────────────────────────────────────────────────────────
16
+
17
+ find_package(Boost 1.74 REQUIRED COMPONENTS system coroutine context)
18
+ find_package(OpenSSL REQUIRED)
19
+ find_package(Threads REQUIRED)
20
+ find_package(nlohmann_json 3.2 REQUIRED)
21
+
22
+ # ─── Executable ───────────────────────────────────────────────────────────────
23
+
24
+ add_executable(collabdocs main.cpp)
25
+
26
+ target_include_directories(collabdocs PRIVATE
27
+ ${CMAKE_CURRENT_SOURCE_DIR}
28
+ ${Boost_INCLUDE_DIRS}
29
+ )
30
+
31
+ target_link_libraries(collabdocs
32
+ Boost::system
33
+ Boost::coroutine
34
+ Boost::context
35
+ OpenSSL::SSL
36
+ OpenSSL::Crypto
37
+ Threads::Threads
38
+ nlohmann_json::nlohmann_json
39
+ )
40
+
41
+ target_compile_options(collabdocs PRIVATE
42
+ -Wall -Wextra -Wno-unused-parameter
43
+ $<$<CONFIG:Debug>:-g -O0 -fsanitize=address>
44
+ $<$<CONFIG:Release>:-O2>
45
+ )
46
+
47
+ target_link_options(collabdocs PRIVATE
48
+ $<$<CONFIG:Debug>:-fsanitize=address>
49
+ )
50
+
51
+ # ─── OT stress test ───────────────────────────────────────────────────────────
52
+
53
+ add_executable(ot_test ot_test.cpp)
54
+
55
+ target_include_directories(ot_test PRIVATE
56
+ ${CMAKE_CURRENT_SOURCE_DIR}
57
+ ${Boost_INCLUDE_DIRS}
58
+ )
59
+
60
+ target_link_libraries(ot_test
61
+ Threads::Threads
62
+ nlohmann_json::nlohmann_json
63
+ )
64
+
65
+ target_compile_options(ot_test PRIVATE -Wall -O2)