forked from microsoft/ccf-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (59 loc) · 2 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
cmake_minimum_required(VERSION 3.16)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake)
project(
lskv
LANGUAGES C CXX
VERSION ${LSKV_VERSION_SHORT})
set(Boost_MAJOR_VERSION 1)
set(Boost_MINOR_VERSION 71)
set(Boost_VERSION ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.0)
set(CCF "ccf_virtual")
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED COMPONENTS log)
include_directories(3rdparty/NumCpp/include)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
# target_link_libraries(lskv PRIVATE ${Boost_LIBRARIES})
endif()
set(EIGEN_PATH "${CMAKE_SOURCE_DIR}/../../eigen-3.4.0")
include_directories(${EIGEN_PATH})
option(CCF_UNSAFE "build with unsafe options" OFF)
if(${CCF_UNSAFE})
if(${COMPILE_TARGET} STREQUAL "sgx")
message(WARNING "Building with unsafe options")
set(CCF "${CCF}_unsafe")
else()
message(
FATAL_ERROR "CCF_UNSAFE is not support for target ${COMPILE_TARGET}")
endif()
endif()
if(NOT TARGET ${CCF})
find_package(${CCF} REQUIRED)
endif()
option(VERBOSE_LOGGING "enable verbose logging" OFF)
add_compile_definitions(LSKV_VERSION="${LSKV_VERSION}")
add_ccf_app(
lskv
SRCS
cpp/app/app.cpp
INCLUDE_DIRS
"${CCF_DIR}/include/ccf/_private"
INSTALL_LIBS
ON)
if(VERBOSE_LOGGING)
message(STATUS "Using verbose logging")
add_compile_definitions(VERBOSE_LOGGING)
else()
message(STATUS "Using terse logging")
endif()
# Generate an ephemeral signing key
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/signing_key.pem
COMMAND openssl genrsa -out ${CMAKE_CURRENT_BINARY_DIR}/signing_key.pem -3
3072)
add_custom_target(app_signing_key ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/signing_key.pem)
sign_app_library(lskv.enclave ${CMAKE_CURRENT_SOURCE_DIR}/oe_sign.conf
${CMAKE_CURRENT_BINARY_DIR}/signing_key.pem INSTALL_LIBS ON)