m4_init/platform/stm32disco/CMakeLists.txt

34 lines
1023 B
CMake
Raw Permalink Normal View History

2023-02-07 14:52:47 +00:00
add_executable(
uexample_test
${PROJECT_SOURCE_DIR}/test/test.c
${PROJECT_SOURCE_DIR}/platform/${PLATFORM}/hal.c
${PROJECT_SOURCE_DIR}/platform/${PLATFORM}/randombytes.c
)
target_include_directories(
uexample_test PRIVATE
#${PROJECT_SOURCE_DIR}/3rd/libopencm3/include
${PROJECT_SOURCE_DIR}/src/common
${PROJECT_SOURCE_DIR}/src/saber
${PROJECT_SOURCE_DIR}/platform
${PROJECT_SOURCE_DIR}/platform/${PLATFORM}
${PROJECT_SOURCE_DIR}/${PLATFORM_INC})
2023-02-06 12:06:10 +00:00
target_link_libraries(
uexample_test PRIVATE
2023-02-07 14:52:47 +00:00
example
2023-02-06 12:06:10 +00:00
--static -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
-T${PROJECT_SOURCE_DIR}/platform/stm32disco/stm32f405x6.ld
-nostartfiles -Wl,--gc-sections
2023-02-07 14:52:47 +00:00
-L${PROJECT_SOURCE_DIR}/3rd/libopencm3/lib -lm -lopencm3_stm32f4)
2023-02-06 12:06:10 +00:00
add_custom_command(
TARGET uexample_test POST_BUILD
COMMAND ${OBJCOPY} -Obinary uexample_test uexample_test.bin
COMMENT "Invoking: objcopy")
add_custom_target(
flash
COMMAND st-flash write uexample_test.bin 0x8000000
COMMENT "Flashing device")