34 lines
1023 B
CMake
34 lines
1023 B
CMake
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})
|
|
|
|
target_link_libraries(
|
|
uexample_test PRIVATE
|
|
example
|
|
--static -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
|
|
-T${PROJECT_SOURCE_DIR}/platform/stm32disco/stm32f405x6.ld
|
|
-nostartfiles -Wl,--gc-sections
|
|
-L${PROJECT_SOURCE_DIR}/3rd/libopencm3/lib -lm -lopencm3_stm32f4)
|
|
|
|
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")
|