39 lines
967 B
CMake
39 lines
967 B
CMake
cmake_minimum_required(VERSION 3.19)
|
|
project(lora-car LANGUAGES C)
|
|
|
|
set(LIBOPENCM3_DIR ${CMAKE_SOURCE_DIR}/libopencm3)
|
|
set(CMAKE_C_STANDARD 99)
|
|
|
|
add_compile_options(
|
|
-Wall
|
|
-Wextra -Wshadow -Wno-unused-variable -Wimplicit-function-declaration
|
|
-Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes
|
|
-ggdb3
|
|
-O0
|
|
)
|
|
|
|
add_link_options(
|
|
|
|
)
|
|
|
|
add_compile_definitions(
|
|
STM32F1
|
|
STM32F103C8T6
|
|
DEBUG
|
|
TARGETS=stm32/f1
|
|
)
|
|
add_executable(lora-car src/main.c src/sx1276.c src/util.c)
|
|
|
|
set_target_properties(lora-car PROPERTIES SUFFIX .elf)
|
|
|
|
add_custom_target(libopencm3 make TARGETS=stm32/f1 -j8 WORKING_DIRECTORY ${LIBOPENCM3_DIR})
|
|
#link_directories(${LIBOPENCM3_DIR}/lib)
|
|
target_link_libraries(lora-car PUBLIC ${LIBOPENCM3_DIR}/lib/libopencm3_stm32f1.a)
|
|
|
|
add_subdirectory(RTT)
|
|
target_link_libraries(lora-car PUBLIC RTT)
|
|
|
|
target_include_directories(lora-car PUBLIC
|
|
RTT ${LIBOPENCM3_DIR}/include src
|
|
)
|