Skip to content

Commit 516b158

Browse files
authored
Enable libc++ bound checks (#6767)
1 parent 9d115ef commit 516b158

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/ccf_app.cmake

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ message(STATUS "Compile target platform: ${COMPILE_TARGET}")
2222
if(USE_LIBCXX)
2323
list(APPEND COMPILE_LIBCXX -stdlib=libc++)
2424
list(APPEND LINK_LIBCXX -lc++ -lc++abi -stdlib=libc++)
25+
26+
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
27+
add_compile_options(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG)
28+
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
29+
add_compile_options(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST)
30+
endif()
31+
2532
endif()
2633

2734
# Enclave library wrapper

0 commit comments

Comments
 (0)