-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
25 lines (16 loc) · 910 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(PROJECT_VER "0.0.21")
set(MEMFAULT_FIRMWARE_SDK ~/Developer/memfault-firmware-sdk)
include(${MEMFAULT_FIRMWARE_SDK}/ports/esp_idf/memfault.cmake)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(spot-check-firmware)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME}.elf
POST_BUILD
COMMAND
python3 ${MEMFAULT_FIRMWARE_SDK}/scripts/fw_build_id.py ${CMAKE_PROJECT_NAME}.elf)
set(SYMBOL_FILE_DIR ${CMAKE_BINARY_DIR}/memfault_elfs)
add_custom_command(TARGET ${PROJECT_NAME}.elf POST_BUILD
COMMAND shasum -a 256 ${PROJECT_NAME}.elf | head -c 8 | xargs -I {} ${CMAKE_COMMAND} -E copy ${PROJECT_NAME}.elf ${SYMBOL_FILE_DIR}/${PROJECT_NAME}-{}.elf
COMMAND ${CMAKE_COMMAND} -E echo "Preserving elf in ${SYMBOL_FILE_DIR}")