From 7ce03a58be3c1b9d493ae34f94ef60a56756fe70 Mon Sep 17 00:00:00 2001 From: Dongjianwei001 Date: Thu, 16 Apr 2026 19:45:28 +0800 Subject: [PATCH] Add compilation options to control whether Securec is compiled Signed-off-by: Dongjianwei001 --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ca324f9..be850f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,12 @@ project(openHiTLS) # for better cross-platform support (especially macOS and Windows). # The SecureC.cmake file is maintained in openHiTLS (not in the submodule) # to avoid git conflicts with upstream libboundscheck repository. -message(STATUS "Configuring securec dependency...") -include(${HiTLS_SOURCE_ROOT_DIR}/platform/SecureC.cmake) +# Securec is compiled by default. If you do not need to compile it, use "cmake -DHITLS_BUILD_SECUREC=OFF" +option(HITLS_BUILD_SECUREC "Build Secure C library (libboundscheck)" ON) +if(HITLS_BUILD_SECUREC) + message(STATUS "Configuring securec dependency...") + include(${HiTLS_SOURCE_ROOT_DIR}/platform/SecureC.cmake) +endif() # ============================================================ # Generate modules.cmake from configure.py