cmake_minimum_required(VERSION 3.20)
project(linux_esp_delivery_postage LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Threads REQUIRED)
get_filename_component(REPO "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
set(CRYPTO "${REPO}/third_party/rweather_crypto" CACHE PATH "Repository-owned rweather Crypto dependency")
add_executable(linux_esp_delivery_postage main.cpp
    "${CRYPTO}/SHA256.cpp" "${CRYPTO}/Hash.cpp" "${CRYPTO}/Crypto.cpp")
target_compile_features(linux_esp_delivery_postage PRIVATE cxx_std_17)
target_include_directories(linux_esp_delivery_postage PRIVATE
    "${REPO}/modules/core_chat/include" "${REPO}/modules/core_sys/include" "${CRYPTO}")
target_compile_options(linux_esp_delivery_postage PRIVATE -UNDEBUG -Wall -Wextra -Werror
    -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-pie -fstack-usage)
target_link_options(linux_esp_delivery_postage PRIVATE -fsanitize=address,undefined -no-pie
    "-Wl,-Map=${CMAKE_CURRENT_BINARY_DIR}/linux_esp_delivery_postage.map")
target_link_libraries(linux_esp_delivery_postage PRIVATE Threads::Threads)
