File tree Expand file tree Collapse file tree 3 files changed +24
-18
lines changed
Expand file tree Collapse file tree 3 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -167,3 +167,12 @@ function(add_ccf_app name)
167167 endif ()
168168 endif ()
169169endfunction ()
170+
171+ # Convenience wrapper to build C-libraries that can be linked in enclave, ie. in
172+ # a CCF application.
173+ function (add_enclave_library_c name files )
174+ add_library (${name} STATIC ${files} )
175+ target_compile_options (${name} PRIVATE -nostdinc )
176+ target_link_libraries (${name} PRIVATE openenclave::oelibc )
177+ set_property (TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON )
178+ endfunction ()
Original file line number Diff line number Diff line change @@ -22,14 +22,6 @@ else()
2222 unset (NODES)
2323endif ()
2424
25- option (COLORED_OUTPUT "Always produce ANSI-colored output (Clang only)." TRUE )
26-
27- if (${COLORED_OUTPUT} )
28- if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
29- add_compile_options (-fcolor-diagnostics )
30- endif ()
31- endif ()
32-
3325option (VERBOSE_LOGGING "Enable verbose logging" OFF )
3426set (TEST_HOST_LOGGING_LEVEL "info" )
3527if (VERBOSE_LOGGING)
@@ -165,13 +157,6 @@ set(HTTP_PARSER_SOURCES ${CCF_DIR}/3rdparty/http-parser/http_parser.c)
165157
166158find_library (CRYPTO_LIBRARY crypto )
167159
168- function (add_enclave_library_c name files )
169- add_library (${name} STATIC ${files} )
170- target_compile_options (${name} PRIVATE -nostdinc )
171- target_link_libraries (${name} PRIVATE openenclave::oelibc )
172- set_property (TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON )
173- endfunction ()
174-
175160include (${CCF_DIR} /cmake/crypto.cmake )
176161include (${CCF_DIR} /cmake/secp256k1.cmake )
177162include (${CCF_DIR} /cmake/quickjs.cmake )
@@ -192,7 +177,11 @@ function(add_unit_test name)
192177 add_san (${name} )
193178
194179 add_test (NAME ${name} COMMAND ${CCF_DIR} /tests/unit_test_wrapper.sh ${name} )
195- set_property (TEST ${name} APPEND PROPERTY LABELS unit_test )
180+ set_property (
181+ TEST ${name}
182+ APPEND
183+ PROPERTY LABELS unit_test
184+ )
196185endfunction ()
197186
198187if ("sgx" IN_LIST COMPILE_TARGETS)
Original file line number Diff line number Diff line change 22# Licensed under the Apache 2.0 License.
33
44# Note: this needs to be done before project(), otherwise CMAKE_*_COMPILER is
5- # already set by CMake If the user has not expressed any choice, we attempt to
5+ # already set by CMake. If the user has not expressed any choice, we attempt to
66# default to Clang >= 7 If they have expressed even a partial choice, the usual
7- # CMake selection logic applies If we cannot find both a suitable clang and a
7+ # CMake selection logic applies. If we cannot find both a suitable clang and a
88# suitable clang++, the usual CMake selection logic applies
99if ((NOT CMAKE_C_COMPILER )
1010 AND (NOT CMAKE_CXX_COMPILER )
@@ -53,4 +53,12 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
5353 )
5454endif ()
5555
56+ option (COLORED_OUTPUT "Always produce ANSI-colored output (Clang only)." TRUE )
57+
58+ if (${COLORED_OUTPUT} )
59+ if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
60+ add_compile_options (-fcolor-diagnostics )
61+ endif ()
62+ endif ()
63+
5664set (CMAKE_CXX_STANDARD 17)
You can’t perform that action at this time.
0 commit comments