~aleteoryx/muditaos

ref: 202dd9306402a91c309aaf30806559330ee06fba muditaos/third-party/CrashDebug/CrashCatcher/CMakeLists.txt -rw-r--r-- 820 bytes
202dd930 — Artur Śleszyński [CP-261] Print crash occurences to log 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
add_library(CrashCatcher OBJECT)
add_library(CrashCatcher::CrashCatcher ALIAS CrashCatcher)

# These files were copied from 'third-party/CrashDebug/src/CrashCatcher' and modified.
#
# Reasons for modification:
# * CrashCatcher_armv7m.S: need to enter MCU user mode in order to create a file dump.
#
# * CrashCatcherPriv.h
#   CrashCatcher.c
#   CrashCatcher.h    : need to expose MCU registers' state for console dump.

target_sources(
        CrashCatcher
    PRIVATE
        CrashCatcherPriv.h
        CrashCatcher.c
        CrashCatcher_armv7m.S
    PUBLIC
        include/CrashCatcher/CrashCatcher.h
)

set_source_files_properties(
        CrashCatcher_armv7m.S
    PROPERTIES LANGUAGE C
)

target_include_directories(
        CrashCatcher
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)