diff --git a/sgx-jvm/jvm-enclave/common/CMakeLists.txt b/sgx-jvm/jvm-enclave/common/CMakeLists.txt index eccf98236e..42f0f8a791 100644 --- a/sgx-jvm/jvm-enclave/common/CMakeLists.txt +++ b/sgx-jvm/jvm-enclave/common/CMakeLists.txt @@ -6,7 +6,9 @@ set(SGX_SDK ${CMAKE_CURRENT_SOURCE_DIR}/../../linux-sgx CACHE STRING "") set(SGX_LIBRARY_PATH ${SGX_SDK}/build/linux CACHE STRING "") set(SGX_SDK_INCLUDE ${SGX_SDK}/common/inc CACHE STRING "") set(GENERATED_RPC_DIR ${CMAKE_CURRENT_BINARY_DIR}/rpc CACHE STRING "") -set(PROGUARD_JAR_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../dependencies/root/usr/share/java/proguard.jar CACHE STRING "") +set(DEPENDENCIES_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../dependencies/root) +set(PROGUARD_JAR_PATH ${DEPENDENCIES_ROOT_DIR}/usr/share/java/proguard.jar CACHE STRING "") +set(DEPENDENCIES_LIBRARY_PATH ${DEPENDENCIES_ROOT_DIR}/usr/lib/x86_64-linux-gnu CACHE STRING "") add_executable(edger8r IMPORTED) set_target_properties(edger8r PROPERTIES IMPORTED_LOCATION ${SGX_LIBRARY_PATH}/sgx_edger8r) diff --git a/sgx-jvm/jvm-enclave/standalone/CMakeLists.txt b/sgx-jvm/jvm-enclave/standalone/CMakeLists.txt index 265a33b8e1..79cefc6e11 100644 --- a/sgx-jvm/jvm-enclave/standalone/CMakeLists.txt +++ b/sgx-jvm/jvm-enclave/standalone/CMakeLists.txt @@ -33,6 +33,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) set(SOURCE_FILES main.cpp) set_source_files_properties(${GENERATED_RPC_DIR}/java_u.c PROPERTIES GENERATED TRUE) +link_directories(${DEPENDENCIES_LIBRARY_PATH}) add_executable(standalone_sgx_verify ${SOURCE_FILES} $) target_include_directories(standalone_sgx_verify PUBLIC ${SGX_SDK_INCLUDE}) target_link_libraries(standalone_sgx_verify urtslib Threads::Threads) diff --git a/sgx-jvm/noop-enclave/CMakeLists.txt b/sgx-jvm/noop-enclave/CMakeLists.txt index 33e82c9cd6..54430b8808 100644 --- a/sgx-jvm/noop-enclave/CMakeLists.txt +++ b/sgx-jvm/noop-enclave/CMakeLists.txt @@ -19,6 +19,8 @@ set(PUBLIC_KEY_NAME_OPENSSL selfsigning.public.pem) set(PUBLIC_KEY_NAME_HSM hsm.public.pem) set(SIGN_HELPER ${PROJECT_SOURCE_DIR}/sign_helper/sign_helper) set(HSM_SGX_TOOL ${PROJECT_SOURCE_DIR}/../hsm-tool/build/libs/sgx-jvm/hsm-tool-1.0-SNAPSHOT.jar) +set(DEPENDENCIES_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/root) +set(DEPENDENCIES_LIBRARY_PATH ${DEPENDENCIES_ROOT_DIR}/usr/lib/x86_64-linux-gnu CACHE STRING "") set(NOOP_ENCLAVE noop_enclave_objects) set(SGX_SDK_INCLUDE ${SGX_SDK}/common/inc) @@ -45,7 +47,7 @@ target_compile_options(${NOOP_ENCLAVE} PUBLIC -nostdinc) add_executable(edger8r IMPORTED) set_target_properties(edger8r PROPERTIES IMPORTED_LOCATION ${SGX_LIBRARY_PATH}/sgx_edger8r) -set(SGX_USE_HARDWARE FALSE) +set(SGX_USE_HARDWARE TRUE) if(SGX_USE_HARDWARE) set(URTS_LIB "sgx_urts") @@ -167,7 +169,12 @@ add_custom_command( COMMAND ${SIGN_HELPER} get-css -in ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGNED_HSM} -out ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_HSM} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGNED_HSM} ) -add_custom_target(sigstruct-hsm DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_HSM}) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_PRETTY_HSM} + COMMAND ${SIGN_HELPER} print-css -in ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_HSM} > ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_PRETTY_HSM} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_HSM} +) +add_custom_target(sigstruct-hsm DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_HSM} ${CMAKE_CURRENT_BINARY_DIR}/${ENCLAVE_SIGSTRUCT_PRETTY_HSM}) # /HSM SIGSTRUCT # test @@ -177,6 +184,7 @@ set_target_properties(urtslib PROPERTIES IMPORTED_LOCATION ${SGX_LIBRARY_PATH}/l set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +link_directories(${DEPENDENCIES_LIBRARY_PATH}) add_executable(noop_test src/test.cpp ${GENERATED_RPC_DIR}/empty_u.c) target_include_directories(noop_test PUBLIC ${SGX_SDK_INCLUDE} ${GENERATED_RPC_DIR}) target_link_libraries(noop_test urtslib Threads::Threads)