added blake3 as a submodule. compiles. Rule No. 1: never push code that won't compiled

This commit is contained in:
2025-10-25 11:54:58 -05:00
parent da73d88dd0
commit 4631911992
3 changed files with 40 additions and 16 deletions

3
.gitmodules vendored
View File

@@ -13,3 +13,6 @@
[submodule "external/json"]
path = external/json
url = https://github.com/nlohmann/json
[submodule "external/BLAKE3"]
path = external/BLAKE3
url = https://github.com/BLAKE3-team/BLAKE3

View File

@@ -1,18 +1,28 @@
cmake_minimum_required(VERSION 3.20)
project(email-tracker LANGUAGES CXX)
# -----------------------------
# Project setup
# -----------------------------
# Use Clang explicitly (you can override from CLI if needed)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
project(email-tracker LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE Release)
# -----------------------------
# Dependencies
# Dependencies (all local submodules)
# -----------------------------
add_subdirectory(external/fmt)
add_subdirectory(external/spdlog)
add_subdirectory(external/tomlplusplus)
add_subdirectory(external/duckdb)
add_subdirectory(external/json)
add_subdirectory(external/BLAKE3/c)
# -----------------------------
# Executables
@@ -23,17 +33,25 @@ add_executable(${PROJECT_NAME}-daemon src/main-daemon.cpp)
# -----------------------------
# Common libraries
# -----------------------------
set(COMMON_LIBS fmt spdlog tomlplusplus duckdb_static nlohmann_json)
set(COMMON_LIBS
fmt
spdlog
tomlplusplus
duckdb_static
nlohmann_json
blake3
)
# -----------------------------
# External includes
# External include directories
# -----------------------------
set(EXTERNAL_INCLUDES
external/fmt/include
external/spdlog/include
external/tomlplusplus/include
external/duckdb/src/include
external/json/include/nlohmann
${CMAKE_CURRENT_SOURCE_DIR}/external/fmt/include
${CMAKE_CURRENT_SOURCE_DIR}/external/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/external/tomlplusplus/include
${CMAKE_CURRENT_SOURCE_DIR}/external/duckdb/src/include
${CMAKE_CURRENT_SOURCE_DIR}/external/json/include/nlohmann
${CMAKE_CURRENT_SOURCE_DIR}/external/BLAKE3/c
)
# -----------------------------
@@ -48,7 +66,7 @@ foreach(dir ${SRC_SUBDIRS})
endforeach()
# -----------------------------
# Automatically include all .cpp under src/
# Automatically include all .cpp files under src/
# Exclude main files to avoid multiple main() definitions
# -----------------------------
file(GLOB_RECURSE ALL_CPP "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
@@ -58,16 +76,18 @@ list(REMOVE_ITEM ALL_CPP
)
# -----------------------------
# Apply to targets
# Apply configuration to all targets
# -----------------------------
foreach(target ${PROJECT_NAME}-client ${PROJECT_NAME}-daemon)
# Link common libraries
target_link_libraries(${target} PRIVATE ${COMMON_LIBS})
# Include directories
target_include_directories(${target} PRIVATE ${EXTERNAL_INCLUDES} ${SRC_INCLUDES})
# Add all .cpp sources dynamically
target_sources(${target} PRIVATE ${ALL_CPP})
endforeach()
# -----------------------------
# Optional: warnings and strict flags for Clang
# -----------------------------
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wconversion)
endif()

1
external/BLAKE3 vendored Submodule

Submodule external/BLAKE3 added at 8bec2fbebf