Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "all" target #513

Merged
merged 6 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ include_directories(
${MSGPACK_INCLUDE_DIR}
)

set(TARGET "all" CACHE STRING "One of sgx, virtual, all")
set(TARGET "sgx" CACHE STRING "One of sgx or virtual")

set(OE_PREFIX "/opt/openenclave" CACHE PATH "Path to Open Enclave install")
message(STATUS "Open Enclave prefix set to ${OE_PREFIX}")
Expand Down Expand Up @@ -142,7 +142,7 @@ configure_file(${CCF_DIR}/tests/tests.sh ${CMAKE_CURRENT_BINARY_DIR}/tests.sh CO
configure_file(${CCF_DIR}/tests/cimetrics_env.sh ${CMAKE_CURRENT_BINARY_DIR}/cimetrics_env.sh COPYONLY)
configure_file(${CCF_DIR}/tests/upload_pico_metrics.py ${CMAKE_CURRENT_BINARY_DIR}/upload_pico_metrics.py COPYONLY)

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
# If OE was built with LINK_SGX=1, then we also need to link SGX
execute_process(COMMAND "ldd" ${OESIGN}
COMMAND "grep" "-c" "sgx"
Expand Down Expand Up @@ -349,7 +349,7 @@ function(add_enclave_lib name app_oe_conf_path enclave_sign_key_path)
"SRCS;INCLUDE_DIRS;LINK_LIBS"
)

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
add_library(${name} SHARED
${ENCLAVE_FILES}
${PARSED_ARGS_SRCS}
Expand Down Expand Up @@ -396,7 +396,7 @@ function(add_enclave_lib name app_oe_conf_path enclave_sign_key_path)
endif()
endif()

if(${TARGET} STREQUAL "virtual" OR ${TARGET} STREQUAL "all")
if(${TARGET} STREQUAL "virtual")
## Build a virtual enclave, loaded as a shared library without OE
set(virt_name ${name}.virtual)
add_library(${virt_name} SHARED
Expand Down Expand Up @@ -480,7 +480,7 @@ target_link_libraries(keygenerator PRIVATE
secp256k1.host
)

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
# Host Executable
add_executable(cchost
${CCF_DIR}/src/host/main.cpp
Expand All @@ -507,7 +507,7 @@ if(NOT ${TARGET} STREQUAL "virtual")
enable_quote_code(cchost)
endif()

if(${TARGET} STREQUAL "virtual" OR ${TARGET} STREQUAL "all")
if(${TARGET} STREQUAL "virtual")
# Virtual Host Executable
add_executable(cchost.virtual
${CCF_DIR}/src/host/main.cpp)
Expand Down
4 changes: 2 additions & 2 deletions cmake/crypto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ file(GLOB_RECURSE EVERCRYPT_SRC "${EVERCRYPT_PREFIX}/*.[cS]")

# We need two versions of EverCrypt, because it depends on libc

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
add_library(evercrypt.enclave STATIC ${EVERCRYPT_SRC})
target_compile_options(evercrypt.enclave PRIVATE -nostdinc -U__linux__ -Wno-everything)
target_compile_definitions(evercrypt.enclave PRIVATE INSIDE_ENCLAVE KRML_HOST_PRINTF=oe_printf KRML_HOST_EXIT=oe_abort)
Expand All @@ -37,7 +37,7 @@ set(CCFCRYPTO_SRC

set(CCFCRYPTO_INC ${CCF_DIR}/src/crypto/ ${EVERCRYPT_INC})

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
add_library(ccfcrypto.enclave STATIC ${CCFCRYPTO_SRC})
target_compile_definitions(ccfcrypto.enclave PRIVATE
INSIDE_ENCLAVE
Expand Down
2 changes: 1 addition & 1 deletion cmake/pbft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(PBFT_SRC
${CMAKE_SOURCE_DIR}/src/consensus/pbft/libbyz/Network_open.cpp
)

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
add_library(libbyz.enclave STATIC ${PBFT_SRC})
target_compile_options(libbyz.enclave PRIVATE
-nostdinc
Expand Down
2 changes: 1 addition & 1 deletion cmake/secp256k1.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.

if(NOT ${TARGET} STREQUAL "virtual")
if(${TARGET} STREQUAL "sgx")
add_library(secp256k1.enclave STATIC ${CCF_DIR}/3rdparty/secp256k1/src/secp256k1.c)
target_include_directories(secp256k1.enclave PUBLIC ${CCF_DIR}/3rdparty/secp256k1)
target_compile_options(secp256k1.enclave PRIVATE -fvisibility=hidden -nostdinc -U__linux__ -Wno-everything)
Expand Down
2 changes: 1 addition & 1 deletion sphinx/source/quickstart/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The full list of build switches can be obtained by running:
* **NO_STRICT_TLS_CIPHERSUITES**: Boolean. Relax the list of accepted TLS ciphersuites. Default to OFF.
* **OE_PREFIX**: Path. Open Enclave install prefix. Default to ``/opt/openenclave``.
* **SAN**: Boolean. Build unit tests with Address and Undefined behaviour sanitizers enabled. Default to OFF.
* **TARGET**: String, one of ``all``, ``sgx``, ``virtual``. Defaults to ``all``, which builds both "virtual" enclaves and actual SGX enclaves.
* **TARGET**: String, one of ``sgx`` or ``virtual``. Defaults to ``sgx``.
* **VERBOSE_LOGGING**: Boolean. Enable all logging levels. Default to OFF.

Running Tests
Expand Down