forked from OpenVPN/openvpn3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (46 loc) · 2.16 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
cmake_minimum_required(VERSION 3.13...3.28)
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"
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"
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)
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/*")
# Use README.rst as the Doxygen main page
# Due to some doxygen oddities, it rejects processing README.rst, but a .md file is fine
# So we copy it into our build tree as a .md file and use that
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/README.rst"
"${CMAKE_CURRENT_BINARY_DIR}/doxygen/mainpage.md"
COPYONLY)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${CMAKE_CURRENT_BINARY_DIR}/doxygen/mainpage.md")
configure_doxygen("OpenVPN 3 Core Library" "doxygen/core")
endif ()