build: add log option

This commit is contained in:
2026-05-13 11:02:36 -03:00
parent 9c96b73d28
commit 1e81167e0b
+11 -4
View File
@@ -11,6 +11,15 @@ project(tinymitm LANGUAGES CXX)
# options
# ------------------------------
option(TINYMITM_TEST "Add test project" OFF)
option(TINYMITM_LOGS "Add logs for proxy" OFF)
if (TINYMITM_TEST)
set(TINYMITM_LOGS ON CACHE BLOOL "" FORCE)
endif()
if (TINYMITM_LOGS)
add_compile_definitions(TINYMITM_LOGS)
endif()
# ---------------------
# external dependencies
@@ -28,14 +37,13 @@ FetchContent_Declare(
)
# seallib config
if (TINYMITM_TEST)
set(SEALLIB_EVENTS ON CACHE BOOL "" FORCE)
if (TINYMITM_LOGS)
set(SEALLIB_LOG ON CACHE BOOL "" FORCE)
endif()
set(SEALLIB_EVENTS ON CACHE BOOL "" FORCE)
FetchContent_GetProperties(seallib)
FetchContent_MakeAvailable(seallib)
# wolfssl config
set(WOLFSSL_ALPN ON CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
@@ -69,7 +77,6 @@ target_link_libraries(tinymitm PRIVATE tinymitm-warnings)
target_link_libraries(tinymitm PUBLIC seallib wolfssl)
set_target_properties(tinymitm PROPERTIES CXX_EXTENSIONS OFF)
# ------------------------------
# test
# ------------------------------