-
Notifications
You must be signed in to change notification settings - Fork 400
/
CMakeLists.txt
60 lines (49 loc) · 2.12 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
cmake_minimum_required(VERSION 3.16...3.30)
project(OpenVPN3-core VERSION 3)
# AddressSanitize - use CXX=clang++ CC=clang cmake -DCMAKE_BUILD_TYPE=asan to build with ASAN
# export UBSAN_OPTIONS=print_stacktrace=1 helps debugging these
set(CMAKE_C_FLAGS_ASAN
"-fsanitize=address,undefined -fno-sanitize-recover=all -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1 -DINSTRUMENTATION_SLOWDOWN"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_ASAN
"-fsanitize=address,undefined -fno-sanitize-recover=all -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1 -DINSTRUMENTATION_SLOWDOWN"
CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
FORCE)
set(CMAKE_LINKER_FLAGS_ASAN
"-fsanitize=address,undefined -fno-sanitize-recover=all -fsanitize-address-use-after-scope"
CACHE STRING "Flags used by the linker during AddressSanitizer builds."
FORCE)
# Append /MP flag for MSVC
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 99)
include(CTest)
include(findcoredeps)
include(ovpn-doxygen)
add_subdirectory(client)
add_subdirectory(test/unittests)
add_subdirectory(test/ovpncli)
add_subdirectory(openvpn/omi)
add_subdirectory(openvpn/ovpnagent/win)
add_subdirectory(openvpn/ovpnagent/mac)
if (ENABLE_DOXYGEN)
# Exclude some project specific directories
set(DOXYGEN_EXCLUDE_PATTERNS
"*/vcpkg_installed/*"
"*/googletest-src/*"
"${PROJECT_SOURCE_DIR}/deps/*"
"*/test/unittests/comp-testdata/*"
"*/test/unittests/input/*"
"*/test/unittests/output/*"
"*/test/unittests/userpass/*"
)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${PROJECT_SOURCE_DIR}/README.md")
configure_doxygen("OpenVPN 3 Core Library" "core" "doxygen/core")
endif ()