-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (29 loc) · 1.13 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
cmake_minimum_required(VERSION 3.10)
project(keystone_examples C CXX ASM)
# check if SDK has been built and KEYSTONE_SDK_DIR configuration variable exists
if (NOT DEFINED KEYSTONE_SDK_DIR)
message(FATAL_ERROR "Please set KEYSTONE_SDK_DIR configuration variable to an installed SDK path")
endif()
set(ENV{KEYSTONE_SDK_DIR} ${KEYSTONE_SDK_DIR})
if (DEFINED PATH)
set(ENV{PATH} ${PATH})
endif()
include(${KEYSTONE_SDK_DIR}/cmake/macros.cmake)
include(ExternalProject)
find_package(Git REQUIRED)
use_riscv_toolchain(${KEYSTONE_BITS})
# export include directory
include_directories(AFTER ${KEYSTONE_SDK_DIR}/include)
# set paths to the libraries
set(KEYSTONE_LIB_HOST ${KEYSTONE_SDK_DIR}/lib/libkeystone-host.a)
set(KEYSTONE_LIB_EDGE ${KEYSTONE_SDK_DIR}/lib/libkeystone-edge.a)
set(KEYSTONE_LIB_VERIFIER ${KEYSTONE_SDK_DIR}/lib/libkeystone-verifier.a)
set(KEYSTONE_LIB_EAPP ${KEYSTONE_SDK_DIR}/lib/libkeystone-eapp.a)
# create a phony target "examples"
add_custom_target("examples")
# add all examples below
add_subdirectory(hello)
add_subdirectory(hello-native)
add_subdirectory(my-hello)
add_subdirectory(attestation)
add_subdirectory(tests)