This repository has been archived by the owner on Jul 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
102 lines (78 loc) · 2.07 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
cmake_minimum_required(VERSION 3.9)
project(ipfn VERSION "0.0.0" LANGUAGES C CXX ASM)
enable_language(CXX)
# https://cmake.org/cmake/help/v3.4/policy/CMP0065.html
cmake_policy(SET CMP0065 OLD)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
endif()
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake"
"${CMAKE_SOURCE_DIR}/cmake/golang"
"${CMAKE_SOURCE_DIR}/cmake/opt"
"${CMAKE_SOURCE_DIR}/cmake/modules"
"${CMAKE_SOURCE_DIR}/cmake/rust"
"${CMAKE_SOURCE_DIR}/cmake/toolchain"
"${CMAKE_SOURCE_DIR}/cmake/util")
include(Util)
include(GoSimple)
include(ExternalProject)
# Configuration defaults
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/config.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/config.cmake)
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake)
endif()
include(ccache)
include(tests)
if(BUILD_RUST_SDK)
enable_language(Rust)
include(CMakeCargo)
include(FindRust)
endif()
# Required for ed25519-donna for sha512
find_package(OpenSSL 1.0.2 REQUIRED)
set(IPFN_LINKER_LIBS "")
set(IPFN_RUNTIME_LINKER_LIBS "")
set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
if(BUILD_DOCS)
find_package(Doxygen)
if(DOXYGEN_FOUND AND BUILD_DEPS_DOCS)
set(BUILD_DOCUMENTATION ON)
else()
set(BUILD_DOCUMENTATION OFF)
endif()
add_subdirectory(docs)
endif()
include_directories(include)
add_subdirectory(third_party)
add_subdirectory(core)
if(BUILD_APPS)
add_subdirectory(python)
endif()
add_subdirectory(apps)
if(BUILD_PYTHON_SDK)
add_subdirectory(python)
endif()
if(BUILD_RUST_SDK)
add_subdirectory(rust)
endif()
if(BUILD_WASM_TARGET)
add_subdirectory(wasm)
endif()
if(BUILD_TESTS)
enable_testing()
find_package(sodium)
add_subdirectory(tests)
endif()
if(BUILD_BENCHMARKS)
add_subdirectory(tests/bench)
endif()