From 3cb891988d3a761f9eee3b77ab63fca642e7743b Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Fri, 17 Jan 2025 14:09:10 +0000 Subject: [PATCH] Move to ccf_app --- cmake/ccf_app.cmake | 7 +++++++ cmake/preproject.cmake | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cmake/ccf_app.cmake b/cmake/ccf_app.cmake index f2049673333b..517729ce134a 100644 --- a/cmake/ccf_app.cmake +++ b/cmake/ccf_app.cmake @@ -22,6 +22,13 @@ message(STATUS "Compile target platform: ${COMPILE_TARGET}") if(USE_LIBCXX) list(APPEND COMPILE_LIBCXX -stdlib=libc++) list(APPEND LINK_LIBCXX -lc++ -lc++abi -stdlib=libc++) + + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + add_compile_options(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG) + elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + add_compile_options(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST) + endif() + endif() # Enclave library wrapper diff --git a/cmake/preproject.cmake b/cmake/preproject.cmake index e9d6c39d2306..e48f76007431 100644 --- a/cmake/preproject.cmake +++ b/cmake/preproject.cmake @@ -92,11 +92,3 @@ if("${COMPILE_TARGET}" STREQUAL "snp" OR "${COMPILE_TARGET}" STREQUAL "virtual") endif() set(CMAKE_CXX_STANDARD 20) - -if(USE_LIBCXX) - if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - add_compile_options(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG) - elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Release") - add_compile_options(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST) - endif() -endif()