Skip to content

Commit

Permalink
fix building issues with example #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan Zhang committed Mar 21, 2018
1 parent 0cf97c7 commit 1529158
Show file tree
Hide file tree
Showing 77 changed files with 16 additions and 25,179 deletions.
12 changes: 6 additions & 6 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
get_filename_component(MBEDTLS_SGX_ROOT_DIR ".." REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")

set(MBEDTLS_SGX_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-${MBEDTLS_VERSION})
set(MBEDTLS_SGX_INCLUDE_DIR ${MBEDTLS_SGX_ROOT}/include)
set(MBEDTLS_SGX_LIBRARY_DIR ${MBEDTLS_SGX_ROOT}/libs)
set(MBEDTLS_SGX_LIB_U ${MBEDTLS_SGX_LIBRARY_DIR}/libmbedtls_SGX_u.a)
set(MBEDTLS_SGX_LIB_T ${MBEDTLS_SGX_LIBRARY_DIR}/libmbedtls_SGX_t.a)
set(MBEDTLS_SGX_LIBRARY_DIR ${MBEDTLS_SGX_ROOT}/lib)
set(MBEDTLS_SGX_LIB_U ${CMAKE_BINARY_DIR}/ocall/libmbedtls_SGX_u.a)
set(MBEDTLS_SGX_LIB_T ${CMAKE_BINARY_DIR}/trusted/libmbedtls_SGX_t.a)

message(${MBEDTLS_SGX_LIB_U})
message(${MBEDTLS_SGX_LIB_T})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down
9 changes: 6 additions & 3 deletions example/enclave/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Enclave_t.c
COMMAND ${SGX_EDGER8R} --trusted Enclave.edl
--search-path ${SGX_SDK}/include
--search-path ${MBEDTLS_SGX_LIBRARY_DIR}
--search-path ${CMAKE_SOURCE_DIR}/trusted
COMMENT "Generating Enclave_t.{c,h}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )

add_library(enclave SHARED ${SOURCE_FILES})

include_directories(
$(CMAKE_CURRENT_SOURCE_DIR)
${CMAKE_SOURCE_DIR}/include
${SGX_SDK}/include
${SGX_SDK}/include/tlibc
${SGX_SDK}/include/stlport
${MBEDTLS_SGX_INCLUDE_DIR}
)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SGX_COMMON_CFLAGS} -nostdinc -fvisibility=hidden -fpie -fstack-protector")
Expand All @@ -51,4 +51,7 @@ add_custom_command(TARGET enclave
-enclave enclave.so
-out enclave.signed.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Signing the enclave => ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/enclave.signed.so")
COMMENT "Signing the enclave => ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/enclave.signed.so")

add_dependencies(enclave ${PROJECT_NAME}_t)
add_dependencies(enclave ${PROJECT_NAME}_u)
343 changes: 0 additions & 343 deletions example/mbedtls_SGX-2.6.0/include/mbedtls/aes.h

This file was deleted.

Loading

0 comments on commit 1529158

Please sign in to comment.