generated from hulk/gd32e23x_template
40 lines
1.1 KiB
CMake
40 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.28)
|
|
include(cmake/toolchain.cmake)
|
|
|
|
project(xlsw_3dp_LDC1612)
|
|
|
|
set(VERSION_MAJOR 0)
|
|
set(VERSION_MINOR 0)
|
|
set(VERSION_PATCH 1)
|
|
set(VERSION "V${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
|
string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
|
|
|
|
enable_language(C)
|
|
enable_language(CXX)
|
|
enable_language(ASM)
|
|
|
|
# Use custom startup.S
|
|
set(TARGET_STARTUP_ASM ${CMAKE_SOURCE_DIR}/startup/startup_gd32e23x.S)
|
|
# Use custom linker script
|
|
set(TARGET_LD_SCRIPT ${CMAKE_SOURCE_DIR}/ld/gd32e23x_gcc.ld)
|
|
# Add GD SDK
|
|
add_subdirectory(sdk)
|
|
|
|
set(TARGET_C_SRC
|
|
${CMAKE_SOURCE_DIR}/src/main.c
|
|
${CMAKE_SOURCE_DIR}/src/gd32e23x_it.c
|
|
${CMAKE_SOURCE_DIR}/src/systick.c
|
|
${CMAKE_SOURCE_DIR}/src/peripheral.c
|
|
${CMAKE_SOURCE_DIR}/src/LDC1612.c
|
|
${CMAKE_SOURCE_DIR}/src/RS485.c
|
|
)
|
|
|
|
add_executable(xlsw_3dp_LDC1612 ${TARGET_C_SRC})
|
|
|
|
target_link_libraries(xlsw_3dp_LDC1612 GD32E23X_SDK)
|
|
target_include_directories(xlsw_3dp_LDC1612 PUBLIC inc)
|
|
|
|
# Generate .bin and .hex
|
|
generate_binary_file(xlsw_3dp_LDC1612 "XLSW_LDC1612_FW")
|
|
generate_hex_file(xlsw_3dp_LDC1612 "XLSW_LDC1612_FW")
|