~aleteoryx/muditaos

muditaos/module-bsp/CMakeLists.txt -rw-r--r-- 2.3 KiB
a405cad6Aleteoryx trim readme 5 days 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

project(module-bsp VERSION 1.0
        DESCRIPTION "BSP module library")

add_library(${PROJECT_NAME} STATIC)
target_sources(
        module-bsp
    PRIVATE
        bsp/bluetooth/Bluetooth.cpp
        bsp/cellular/bsp_cellular.cpp
        bsp/common.cpp
        bsp/lpm/bsp_lpm.cpp
        devices/Device.cpp
        devices/power/CW2015.cpp
        devices/power/MP2615GQ.cpp
        devices/temperature/CT7117.cpp
        drivers/dma/DriverDMA.cpp
        drivers/dmamux/DriverDMAMux.cpp
        drivers/gpio/DriverGPIO.cpp
        drivers/i2c/DriverI2C.cpp
        drivers/lpspi/DriverLPSPI.cpp
        drivers/lpuart/DriverLPUART.cpp
        drivers/pll/DriverPLL.cpp
        drivers/pwm/DriverPWM.cpp
        drivers/semc/DriverSEMC.cpp
        drivers/usdhc/DriverUSDHC.cpp
)
add_board_subdirectory(board)

# Board specific compilation definitions,options,include directories and features
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_CONFIG_DEFINITIONS})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_TARGET})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDES})
target_compile_options(${PROJECT_NAME}
    PRIVATE
    -Wno-sign-compare
    -Wno-missing-field-initializers
    -Wno-unused-function
    -Wno-switch

    # C only flags
    $<$<COMPILE_LANGUAGE:C>:-Wno-old-style-declaration>
)

target_compile_definitions(${PROJECT_NAME}

        PUBLIC
        -DFSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1
        -D__STARTUP_INITIALIZE_NONCACHEDATA
        -D__USE_CMSIS
        -DDEBUG_VCOM=1
        -DDEBUG_USB=0
        )

target_include_directories(${PROJECT_NAME}
        PUBLIC
        $<BUILD_INTERFACE:
            ${CMAKE_CURRENT_SOURCE_DIR}
            ${CMAKE_CURRENT_SOURCE_DIR}/bsp/headset
            ${CMAKE_CURRENT_SOURCE_DIR}/drivers/gpio
            ${CMAKE_CURRENT_SOURCE_DIR}/drivers/i2c
            ${CMAKE_CURRENT_SOURCE_DIR}/bsp
        >
)

add_subdirectory(hal)
add_subdirectory(sink)

target_link_libraries(${PROJECT_NAME}
    PUBLIC
        hal
        eventstore
        module-os
        magic_enum
        utility
    PRIVATE
        purefs-paths
        time-constants
        pure-core
)

if (${ENABLE_TESTS})
    add_subdirectory(tests)
endif ()