-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
66 lines (52 loc) · 3.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.8)
project(IngenicHAL C CXX ASM)
file(GLOB_RECURSE IngenicHAL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.*" "${CMAKE_CURRENT_SOURCE_DIR}/src/peripheral/*.*")
add_library(IngenicHAL ${IngenicHAL_SOURCES})
target_include_directories(IngenicHAL PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
add_executable(ingenic_gpio_x1000 utils/ingenic_gpio.c)
target_compile_definitions(ingenic_gpio_x1000 PRIVATE -DXHAL_CHIP_X1000)
target_link_libraries(ingenic_gpio_x1000 IngenicHAL)
add_executable(ingenic_gpio_x2000 utils/ingenic_gpio.c)
target_compile_definitions(ingenic_gpio_x2000 PRIVATE -DXHAL_CHIP_X2000)
target_link_libraries(ingenic_gpio_x2000 IngenicHAL)
add_executable(x2000_pwm_dma examples/x2000_pwm_dma.c)
target_compile_definitions(x2000_pwm_dma PRIVATE -DXHAL_CHIP_X2000)
target_link_libraries(x2000_pwm_dma IngenicHAL)
add_executable(st7789_bitbang_x2000 examples/st7789_bitbang.c)
target_compile_definitions(st7789_bitbang_x2000 PRIVATE -DXHAL_CHIP_X2000)
target_link_libraries(st7789_bitbang_x2000 IngenicHAL)
add_executable(st7789_bitbang_x1000 examples/st7789_bitbang.c)
target_compile_definitions(st7789_bitbang_x1000 PRIVATE -DXHAL_CHIP_X1000)
target_link_libraries(st7789_bitbang_x1000 IngenicHAL)
add_executable(fb_draw_rect utils/fb_draw_rect.c)
add_executable(minicore_util utils/minicore_util.c)
set(libMiniCore_SOURCES
src/minicore/init/start.S
src/minicore/init/exception.S
src/minicore/init/init.c
src/minicore/init/irq.c
)
add_executable(minicore_gpio_flip ${libMiniCore_SOURCES} ${IngenicHAL_SOURCES} examples/minicore_gpio_flip.c)
target_compile_definitions(minicore_gpio_flip PRIVATE -DXHAL_CHIP_X1000)
target_compile_options(minicore_gpio_flip PUBLIC -march=mips32r2 -nostdlib -mno-abicalls -fno-pic -EL -msoft-float -Ofast -membedded-data -fno-math-errno)
target_link_options(minicore_gpio_flip PUBLIC
-T${CMAKE_CURRENT_SOURCE_DIR}/src/minicore/linker/x1000.lds
-Wl,--print-memory-usage
-Wl,--gc-sections
-march=mips32r2 -nostdlib -mno-abicalls -fno-pic -EL -msoft-float -Ofast -membedded-data -fno-math-errno)
target_include_directories(minicore_gpio_flip PUBLIC src/minicore src/)
add_custom_command(TARGET minicore_gpio_flip POST_BUILD
COMMAND mipsel-linux-gnu-objcopy --remove-section=.dynsym -O binary minicore_gpio_flip minicore_gpio_flip.bin
COMMENT "Building BIN file: minicore_gpio_flip.bin")
add_executable(minicore_rgb_lcd ${libMiniCore_SOURCES} ${IngenicHAL_SOURCES} examples/minicore_rgb_lcd.c)
target_compile_definitions(minicore_rgb_lcd PRIVATE -DXHAL_CHIP_X1000)
target_compile_options(minicore_rgb_lcd PUBLIC -march=mips32r2 -nostdlib -mno-abicalls -fno-pic -EL -msoft-float -Ofast -membedded-data -fno-math-errno)
target_link_options(minicore_rgb_lcd PUBLIC
-T${CMAKE_CURRENT_SOURCE_DIR}/src/minicore/linker/x1000.lds
-Wl,--print-memory-usage
-Wl,--gc-sections
-march=mips32r2 -nostdlib -mno-abicalls -fno-pic -EL -msoft-float -Ofast -membedded-data -fno-math-errno)
target_include_directories(minicore_rgb_lcd PUBLIC src/minicore src/)
add_custom_command(TARGET minicore_rgb_lcd POST_BUILD
COMMAND mipsel-linux-gnu-objcopy --remove-section=.dynsym -O binary minicore_rgb_lcd minicore_rgb_lcd.bin
COMMENT "Building BIN file: minicore_rgb_lcd.bin")