build: add warings
This commit is contained in:
+12
-2
@@ -39,6 +39,16 @@ set(WOLFSSL_ALT_NAMES ON CACHE BOOL "" FORCE)
|
|||||||
FetchContent_GetProperties(wolfssl)
|
FetchContent_GetProperties(wolfssl)
|
||||||
FetchContent_MakeAvailable(wolfssl)
|
FetchContent_MakeAvailable(wolfssl)
|
||||||
|
|
||||||
|
# ---------------------
|
||||||
|
# warnings
|
||||||
|
# ---------------------
|
||||||
|
add_library(tinymitm-warnings INTERFACE)
|
||||||
|
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
|
target_compile_options(tinymitm-warnings INTERFACE /W4 /WX)
|
||||||
|
else()
|
||||||
|
target_compile_options(tinymitm-warnings INTERFACE -Wall -Wextra -Werror)
|
||||||
|
endif()
|
||||||
|
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
# proxy
|
# proxy
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
@@ -46,7 +56,7 @@ file(GLOB_RECURSE TINYMITM_SOURCES CONFIGURE_DEPENDS "src/proxy/*.cpp" "src/prox
|
|||||||
add_library(tinymitm STATIC ${TINYMITM_SOURCES})
|
add_library(tinymitm STATIC ${TINYMITM_SOURCES})
|
||||||
target_include_directories(tinymitm PUBLIC src/proxy)
|
target_include_directories(tinymitm PUBLIC src/proxy)
|
||||||
target_compile_features(tinymitm PUBLIC cxx_std_20)
|
target_compile_features(tinymitm PUBLIC cxx_std_20)
|
||||||
target_link_libraries(tinymitm PRIVATE wolfssl)
|
target_link_libraries(tinymitm PRIVATE tinymitm-warnings wolfssl)
|
||||||
target_link_libraries(tinymitm PUBLIC seallib)
|
target_link_libraries(tinymitm PUBLIC seallib)
|
||||||
set_target_properties(tinymitm PROPERTIES CXX_EXTENSIONS OFF)
|
set_target_properties(tinymitm PROPERTIES CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
@@ -57,5 +67,5 @@ if (TINYMITM_TEST)
|
|||||||
file(GLOB_RECURSE TINYMITM_TEST_SOURCES CONFIGURE_DEPENDS "src/test/*.h" "src/test/*.cpp")
|
file(GLOB_RECURSE TINYMITM_TEST_SOURCES CONFIGURE_DEPENDS "src/test/*.h" "src/test/*.cpp")
|
||||||
add_executable(tinymitm-test ${TINYMITM_TEST_SOURCES})
|
add_executable(tinymitm-test ${TINYMITM_TEST_SOURCES})
|
||||||
target_include_directories(tinymitm-test PRIVATE "src/test")
|
target_include_directories(tinymitm-test PRIVATE "src/test")
|
||||||
target_link_libraries(tinymitm-test PRIVATE tinymitm)
|
target_link_libraries(tinymitm-test PRIVATE tinymitm-warnings tinymitm)
|
||||||
endif()
|
endif()
|
||||||
Reference in New Issue
Block a user