38 lines
910 B
CMake
38 lines
910 B
CMake
cmake_minimum_required(VERSION 3.19)
|
|
project(dht_test 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
|
|
)
|
|
add_executable(dht_test main.c)
|
|
|
|
set_target_properties(dht_test PROPERTIES SUFFIX .elf)
|
|
|
|
add_custom_target(libopencm3 make TARGETS=stm32/f1 -j8 WORKING_DIRECTORY ${LIBOPENCM3_DIR})
|
|
#link_directories(${LIBOPENCM3_DIR}/lib)
|
|
target_link_libraries(dht_test PUBLIC ${LIBOPENCM3_DIR}/lib/libopencm3_stm32f1.a)
|
|
|
|
add_subdirectory(RTT)
|
|
target_link_libraries(dht_test PUBLIC RTT)
|
|
|
|
target_include_directories(dht_test PUBLIC
|
|
RTT ${LIBOPENCM3_DIR}/include
|
|
)
|