This repository has been archived by the owner on May 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
CMakeLists.txt
51 lines (43 loc) · 1.97 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
cmake_minimum_required(VERSION 3.13...3.23)
# initialize the SDK based on PICO_SDK_PATH
include(pico_sdk_import.cmake)
project(RP2040_GB C CXX)
# Initialize the Raspberry Pi Pico SDK
pico_sdk_init()
add_executable(RP2040_GB src/main.c src/rom.c src/mk_ili9225.c)
target_include_directories(RP2040_GB PRIVATE inc)
SET(ENABLE_SOUND FALSE CACHE BOOL "Enable Sound emulation")
if(ENABLE_SOUND)
ADD_COMPILE_DEFINITIONS(ENABLE_SOUND=1)
target_sources(RP2040_GB PRIVATE ext/minigb_apu/minigb_apu.c)
target_include_directories(RP2040_GB PRIVATE ext/minigb_apu)
else()
ADD_COMPILE_DEFINITIONS(ENABLE_SOUND=0)
endif()
target_link_libraries(RP2040_GB
pico_stdlib pico_stdio pico_bootrom pico_multicore pico_stdio pico_multicore
hardware_clocks hardware_pio hardware_vreg hardware_pio
hardware_sync hardware_pll hardware_spi hardware_irq hardware_dma
pico_binary_info)
target_compile_definitions(RP2040_GB PRIVATE
PARAM_ASSERTIONS_DISABLE_ALL=1
PICO_ENTER_USB_BOOT_ON_EXIT=1
PICO_STDIO_ENABLE_CRLF_SUPPORT=0
PICO_STDIO_DEFAULT_CRLF=0
PICO_PRINTF_SUPPORT_FLOAT=0
PICO_PRINTF_SUPPORT_EXPONENTIAL=0
PICO_PRINTF_SUPPORT_LONG_LONG=1
PICO_PRINTF_SUPPORT_PTRDIFF_T=0)
function(pico_add_verbose_dis_output TARGET)
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_OBJDUMP} -h $<TARGET_FILE:${TARGET}> >$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
COMMAND ${CMAKE_OBJDUMP} -drwCSl $<TARGET_FILE:${TARGET}> >>$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
)
endfunction()
pico_set_binary_type(RP2040_GB copy_to_ram)
#pico_set_binary_type(RP2040_GB no_flash)
pico_enable_stdio_usb(RP2040_GB 1)
pico_enable_stdio_uart(RP2040_GB 0)
pico_add_verbose_dis_output(RP2040_GB)
pico_add_bin_output(RP2040_GB)
pico_add_uf2_output(RP2040_GB)