2026-09-23 17:27:54 +02:00
|
|
|
cmake_minimum_required(VERSION 3.22)
|
2026-11-11 00:13:57 +01:00
|
|
|
# ESP32-C5 station on the microbu_v2x and Vanetza components.
|
|
|
|
|
# Verify the vendored radio source before configuration.
|
|
|
|
|
set(_otm_upstream "${CMAKE_CURRENT_LIST_DIR}/components/microbu_v2x/third_party/otm/main/tx_custom.c")
|
2026-09-23 17:27:54 +02:00
|
|
|
if(EXISTS "${_otm_upstream}")
|
|
|
|
|
file(READ "${_otm_upstream}" _otm_upstream_text)
|
|
|
|
|
string(REPLACE "\r\n" "\n" _otm_upstream_text "${_otm_upstream_text}")
|
|
|
|
|
string(SHA256 _otm_upstream_hash "${_otm_upstream_text}")
|
|
|
|
|
if(NOT _otm_upstream_hash STREQUAL "cb1dccfef96912ca59275e8a9102f41f56925b94a19d4a4629082aaeb779be1b")
|
2026-11-11 00:13:57 +01:00
|
|
|
message(FATAL_ERROR "The vendored OpenTrafficMap radio source differs from its pinned SHA256")
|
2026-09-23 17:27:54 +02:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
set(_otm_checked_in "${CMAKE_CURRENT_LIST_DIR}/main/otm_tx_custom.c")
|
|
|
|
|
file(READ "${_otm_checked_in}" _otm_checked_in_text)
|
|
|
|
|
string(REPLACE "\r\n" "\n" _otm_checked_in_text "${_otm_checked_in_text}")
|
|
|
|
|
string(SHA256 _otm_checked_in_hash "${_otm_checked_in_text}")
|
2026-11-11 00:13:57 +01:00
|
|
|
if(NOT _otm_checked_in_hash STREQUAL "db32dd6e2a50decf7add4fc09ea14ee1f060bf07a047c5c7bd3cdc2b1190b019")
|
|
|
|
|
message(FATAL_ERROR "The application radio source differs from its pinned SHA256")
|
2026-09-23 17:27:54 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(SDKCONFIG_DEFAULTS "${CMAKE_CURRENT_LIST_DIR}/sdkconfig.defaults")
|
|
|
|
|
set(COMPONENTS main)
|
2026-11-11 00:13:57 +01:00
|
|
|
set(MICROBU_CRYPTO_ADAPTER_COMPONENT "" CACHE STRING
|
|
|
|
|
"Optional ESP IDF component implementing the selected external Vanetza crypto backend")
|
2026-08-04 17:58:07 +02:00
|
|
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
2026-11-11 00:13:57 +01:00
|
|
|
project(microbu_firmware)
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/cmake/no_efuse_writes.cmake")
|
2026-09-23 17:27:54 +02:00
|
|
|
add_compile_options(-Wno-error -Wno-cpp -Wno-error=implicit-function-declaration)
|
2026-11-11 00:13:57 +01:00
|
|
|
foreach(_stack vanetza microbu_v2x)
|
|
|
|
|
idf_component_get_property(_stack_lib ${_stack} COMPONENT_LIB)
|
|
|
|
|
if(_stack_lib)
|
|
|
|
|
target_compile_options(${_stack_lib} PRIVATE -Wno-error=implicit-function-declaration -Wno-error=cpp)
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
2026-09-23 17:27:54 +02:00
|
|
|
# GCC 15's stricter -Warray-bounds false-positives on NimBLE's fixed-size bond-store arrays
|
2026-11-11 00:13:57 +01:00
|
|
|
# (upstream Apache Mynewt code, not ours); demote to a warning so the component still builds.
|
2026-09-23 17:27:54 +02:00
|
|
|
idf_component_get_property(bt_lib bt COMPONENT_LIB)
|
|
|
|
|
if(bt_lib)
|
|
|
|
|
target_compile_options(${bt_lib} PRIVATE -Wno-error=array-bounds)
|
|
|
|
|
endif()
|
2026-11-11 00:13:57 +01:00
|
|
|
|