From f5442a8fc4b8bec90f4e61c585ced9d5cd0909fa Mon Sep 17 00:00:00 2001 From: neru Date: Fri, 19 Jun 2026 05:50:50 -0300 Subject: [PATCH] build: check TINYMITM_LOGS From cache, use target compile def --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ff8972..ca8b4fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,10 +17,6 @@ if (TINYMITM_TEST) set(TINYMITM_LOGS ON CACHE BOOL "" FORCE) endif() -if (TINYMITM_LOGS) - add_compile_definitions(TINYMITM_LOGS) -endif() - # --------------------- # external dependencies # --------------------- @@ -38,7 +34,7 @@ FetchContent_Declare( # seallib config set(SEALLIB_EVENTS ON CACHE BOOL "" FORCE) -if (TINYMITM_LOGS) +if (TINYMITM_LOGS OR $CACHE{TINYMITM_LOGS}) set(SEALLIB_LOG ON CACHE BOOL "" FORCE) endif() FetchContent_GetProperties(seallib) @@ -81,6 +77,10 @@ target_link_libraries(tinymitm PRIVATE tinymitm-warnings) target_link_libraries(tinymitm PUBLIC seallib wolfssl) set_target_properties(tinymitm PROPERTIES CXX_EXTENSIONS OFF) +if (TINYMITM_LOGS OR $CACHE{TINYMITM_LOGS}) + target_compile_definitions(tinymitm PUBLIC TINYMITM_LOGS) +endif() + # ------------------------------ # test # ------------------------------