Skip to content

Commit

Permalink
Remove "all" target (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyashton authored and achamayou committed Nov 4, 2019
1 parent 1a057af commit 62c6a24
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
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, virtual, or 'sgx;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("sgx" IN_LIST TARGET)
# 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("sgx" IN_LIST TARGET)
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("virtual" IN_LIST TARGET)
## 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("sgx" IN_LIST TARGET)
# 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("virtual" IN_LIST TARGET)
# 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("sgx" IN_LIST TARGET)
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("sgx" IN_LIST TARGET)
add_library(ccfcrypto.enclave STATIC ${CCFCRYPTO_SRC})
target_compile_definitions(ccfcrypto.enclave PRIVATE
INSIDE_ENCLAVE
Expand Down
4 changes: 2 additions & 2 deletions 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("sgx" IN_LIST TARGET)
add_library(libbyz.enclave STATIC ${PBFT_SRC})
target_compile_options(libbyz.enclave PRIVATE
-nostdinc
Expand Down Expand Up @@ -78,7 +78,7 @@ add_e2e_test(
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_logging_pbft.py
)

if(${TARGET} STREQUAL "virtual")
if("virtual" IN_LIST TARGET)

add_library(libbyz.host STATIC ${PBFT_SRC})
target_compile_options(libbyz.host PRIVATE -stdlib=libc++)
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("sgx" IN_LIST TARGET)
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``, ``virtual``, or ``sgx;virtual``. Defaults to ``sgx;virtual``, which builds both "virtual" enclaves and actual SGX enclaves.
* **VERBOSE_LOGGING**: Boolean. Enable all logging levels. Default to OFF.

Running Tests
Expand Down

0 comments on commit 62c6a24

Please sign in to comment.