gintctl/CMakeLists.txt

147 lines
4.0 KiB
CMake
Raw Permalink Normal View History

2021-01-29 13:28:26 +01:00
# gintctl: gint's control application
cmake_minimum_required(VERSION 3.15)
2023-04-10 13:52:56 +02:00
project(gintctl VERSION 2.10.0 LANGUAGES C ASM)
2021-01-29 13:28:26 +01:00
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
2022-05-16 22:59:00 +02:00
find_package(Gint 2.8 REQUIRED)
2021-01-29 13:28:26 +01:00
find_package(LibProf 2.1 REQUIRED)
find_package(LibImg 2.1 REQUIRED)
find_package(JustUI 1.0 REQUIRED)
2021-01-29 13:28:26 +01:00
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
2021-01-29 13:28:26 +01:00
set(SOURCES
src/gintctl.c
src/menu.c
src/plot.c
src/usb_commands.c
2021-01-29 13:28:26 +01:00
src/util.c
src/gint/cpumem.c
2021-01-29 13:28:26 +01:00
src/gint/dma.c
src/gint/drivers.c
2021-01-29 13:28:26 +01:00
src/gint/dsp.c
src/gint/dsp.s
src/gint/dump.c
src/gint/gray.c
2022-05-15 23:45:19 +02:00
src/gint/image.c
2021-01-29 13:28:26 +01:00
src/gint/keyboard.c
src/gint/kmalloc.c
2022-05-15 23:45:19 +02:00
src/gint/overclock.c
2021-01-29 13:28:26 +01:00
src/gint/ram.c
src/gint/render.c
2021-01-29 13:28:26 +01:00
src/gint/rtc.c
src/gint/spuram.c
src/gint/timer.c
src/gint/timer_callbacks.c
src/gint/tlb.c
src/gint/topti.c
src/gint/usb.c
src/gint/usbtrace.c
src/libs/bfile.c
src/libs/justui.c
2021-01-29 13:28:26 +01:00
src/libs/openlibm.c
src/mem/mem.c
src/perf/cpucache.c
src/perf/cpucache.S
src/perf/cpu.c
src/perf/cpu.S
2021-01-29 13:28:26 +01:00
src/perf/interrupt.c
src/perf/libprof.c
src/perf/memory.c
src/perf/memory.S
2021-01-29 13:28:26 +01:00
src/perf/render.c
src/regs/regs.c
src/widgets/gscreen.c
src/widgets/gtable.c
2021-01-29 13:28:26 +01:00
)
set(ASSETS_fx
assets-fx/fonts/hexa.png
assets-fx/fonts/mini.png
assets-fx/fonts/title.png
2021-01-29 13:28:26 +01:00
assets-fx/fonts/uf5x7
assets-fx/img/bopti_1col.png
assets-fx/img/bopti_2col.png
assets-fx/img/bopti_3col.png
assets-fx/img/kbd_events.png
assets-fx/img/kbd_pressed.png
assets-fx/img/kbd_released.png
2021-01-29 13:28:26 +01:00
assets-fx/img/libimg_swords.png
assets-fx/img/opt_dump.png
assets-fx/img/opt_gint_bopti.png
assets-fx/img/opt_gint_cpumem.png
assets-fx/img/opt_gint_dma.png
assets-fx/img/opt_gint_drivers.png
2021-01-29 13:28:26 +01:00
assets-fx/img/opt_gint_gray.png
assets-fx/img/opt_gint_keyboard.png
assets-fx/img/opt_gint_kmalloc.png
2021-01-29 13:28:26 +01:00
assets-fx/img/opt_gint_ram.png
assets-fx/img/opt_gint_rtc.png
assets-fx/img/opt_gint_spuram.png
assets-fx/img/opt_gint_timer_callbacks.png
assets-fx/img/opt_gint_timers.png
assets-fx/img/opt_gint_tlb.png
assets-fx/img/opt_gint_usb.png
assets-fx/img/opt_libs_bfile.png
assets-fx/img/opt_libs_jui.png
2021-01-29 13:28:26 +01:00
assets-fx/img/opt_main.png
assets-fx/img/opt_mem.png
2021-08-11 01:35:34 +02:00
assets-fx/img/opt_perf_cpu.png
2021-01-29 13:28:26 +01:00
assets-fx/img/opt_perf_libprof.png
assets-fx/img/opt_perf_memory.png
assets-fx/img/opt_perf_memory_sh3.png
2021-01-29 13:28:26 +01:00
assets-fx/img/opt_perf_render.png
assets-fx/img/profile_gray_alpha.png
assets-fx/img/profile_gray.png
assets-fx/img/profile_mono_alpha.png
assets-fx/img/profile_mono.png
assets-fx/img/rtc_arrows.png
assets-fx/img/rtc_segments.png
assets-fx/img/tlb_cells.png
)
set(ASSETS_cg
assets-cg/fonts/font8x9_bold.png
assets-cg/img/kbd_events.png
2021-01-29 13:28:26 +01:00
assets-cg/img/kbd_pressed.png
assets-cg/img/kbd_released.png
assets-cg/img/libimg_even_odd.png
assets-cg/img/libimg_odd_even.png
assets-cg/img/libimg_sq_even.png
assets-cg/img/libimg_sq_odd.png
assets-cg/img/libimg_train.png
assets-cg/img/rtc_arrows.png
assets-cg/img/rtc_segments.png
assets-cg/img/swift.png
assets-cg/img/swords.png
)
fxconv_declare_assets(${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(gintctl ${SOURCES} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(gintctl PRIVATE
-Wall -Wextra -Os)
target_link_options(gintctl PRIVATE
-Wl,-Map=map -Wl,--print-memory-usage)
target_include_directories(gintctl PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
2021-01-29 13:28:26 +01:00
target_link_libraries(gintctl
2022-05-15 13:59:08 +02:00
LibProf::LibProf JustUI::JustUI Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
target_link_libraries(gintctl LibImg::LibImg)
endif()
2021-01-29 13:28:26 +01:00
2022-03-24 19:16:26 +01:00
2021-01-29 13:28:26 +01:00
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
generate_g1a(TARGET gintctl OUTPUT "gintctl.g1a"
NAME "gintctl" INTERNAL "@GINTCTL" ICON assets-fx/icon.png)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET gintctl OUTPUT "gintctl.g3a"
NAME "" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
2022-03-24 19:16:26 +01:00
add_custom_command(TARGET gintctl POST_BUILD
COMMAND echo -n "g3a file size: "
COMMAND stat -c %s "${CMAKE_CURRENT_SOURCE_DIR}/gintctl.g3a")
2021-01-29 13:28:26 +01:00
endif()