62 lines
1.1 KiB
CMake
62 lines
1.1 KiB
CMake
|
|
add_executable(${PROJECT_NAME}
|
|
main.c
|
|
ch32fun.c
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
|
${CMAKE_SOURCE_DIR}
|
|
${CMAKE_SOURCE_DIR}/extralibs
|
|
)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
#ch32fun
|
|
)
|
|
|
|
target_compile_options(${PROJECT_NAME} PUBLIC
|
|
-g
|
|
-Os
|
|
-flto
|
|
-ffunction-sections
|
|
-fdata-sections
|
|
-fmessage-length=0
|
|
-msmall-data-limit=8
|
|
-march=rv32ec
|
|
-mabi=ilp32e
|
|
-DCH32V003=1
|
|
-static-libgcc
|
|
-nostdlib
|
|
-Wl,--print-memory-usage
|
|
-Wl,-Map=${PROJECT_NAME}.map
|
|
-lgcc
|
|
-Wl,--gc-sections
|
|
-T${CMAKE_SOURCE_DIR}/src/linker_script.ld
|
|
)
|
|
|
|
target_link_options(${PROJECT_NAME} PUBLIC
|
|
-g
|
|
-Os
|
|
-flto
|
|
-ffunction-sections
|
|
-fdata-sections
|
|
-fmessage-length=0
|
|
-msmall-data-limit=8
|
|
-march=rv32ec
|
|
-mabi=ilp32e
|
|
-DCH32V003=1
|
|
-static-libgcc
|
|
-nostdlib
|
|
-Wl,--print-memory-usage
|
|
-Wl,-Map=${PROJECT_NAME}.map
|
|
-lgcc
|
|
-Wl,--gc-sections
|
|
-T${CMAKE_SOURCE_DIR}/src/linker_script.ld
|
|
)
|
|
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".elf")
|
|
|
|
|
|
#add_subdirectory(attic)
|
|
add_subdirectory(ADC)
|
|
add_subdirectory(RegEdit)
|