Files
MicrOBU/obu-firmware/CMakeLists.txt
T

42 lines
2.2 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.22)
# 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")
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")
message(FATAL_ERROR "The vendored OpenTrafficMap radio source differs from its pinned SHA256")
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}")
if(NOT _otm_checked_in_hash STREQUAL "db32dd6e2a50decf7add4fc09ea14ee1f060bf07a047c5c7bd3cdc2b1190b019")
message(FATAL_ERROR "The application radio source differs from its pinned SHA256")
endif()
set(SDKCONFIG_DEFAULTS "${CMAKE_CURRENT_LIST_DIR}/sdkconfig.defaults")
set(COMPONENTS main)
set(MICROBU_CRYPTO_ADAPTER_COMPONENT "" CACHE STRING
"Optional ESP IDF component implementing the selected external Vanetza crypto backend")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(microbu_firmware)
include("${CMAKE_CURRENT_LIST_DIR}/cmake/no_efuse_writes.cmake")
add_compile_options(-Wno-error -Wno-cpp -Wno-error=implicit-function-declaration)
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()
# GCC 15's stricter -Warray-bounds false-positives on NimBLE's fixed-size bond-store arrays
# (upstream Apache Mynewt code, not ours); demote to a warning so the component still builds.
idf_component_get_property(bt_lib bt COMPONENT_LIB)
if(bt_lib)
target_compile_options(${bt_lib} PRIVATE -Wno-error=array-bounds)
endif()