build: add list and build scripts

This commit is contained in:
2026-05-12 14:36:14 -03:00
commit 5058627713
4 changed files with 109 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
# ------------------------------
# cmake config / project
# ------------------------------
cmake_minimum_required(VERSION 4.1.0)
project(tinymitm LANGUAGES CXX)
# ------------------------------
# options
# ------------------------------
option(TINYMITM_TEST "Add test project" OFF)
# ------------------------------
# proxy
# ------------------------------
file(GLOB_RECURSE TINYMITM_SOURCES CONFIGURE_DEPENDS "src/proxy/*.cpp" "src/proxy/*.h")
add_library(tinymitm STATIC ${TINYMITM_SOURCES})
target_include_directories(tinymitm PUBLIC src/proxy)
target_compile_features(tinymitm PUBLIC cxx_std_20)
set_target_properties(tinymitm PROPERTIES CXX_EXTENSIONS OFF)
# ------------------------------
# test
# ------------------------------
if (TINYMITM_TEST)
file(GLOB_RECURSE TINYMITM_TEST_SOURCES CONFIGURE_DEPENDS "src/test/*.h" "src/test/*.cpp")
add_executable(tinymitm-test ${TINYMITM_TEST_SOURCES})
target_include_directories(tinymitm-test PRIVATE "src/test")
target_link_libraries(tinymitm-test PRIVATE tinymitm)
endif()