FxLibcTest/CMakeLists.txt

54 lines
1.6 KiB
CMake

# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
# toolchain file and module path of the fxSDK
cmake_minimum_required(VERSION 3.15)
project(FxLibcTest)
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
find_package(Gint 2.4 REQUIRED)
find_package(JustUI 1.0 REQUIRED)
# FXLIBC_INSTALL: Additional folders to read includes and libs from
set(SOURCES
src/main.c
src/test.c
src/widgets/fbar.c
src/widgets/fbrowser.c
src/widgets/flist.c
src/widgets/gscreen.c
# ctype
src/ctype/trivialties.c
# string
src/string/memarray.c
src/string/core.c
)
# fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS_fx
)
set(ASSETS_cg
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(fxlibctest ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(fxlibctest PRIVATE -Wall -Wextra -Os)
target_link_options(fxlibctest PRIVATE -Wl,-Map=map -Wl,--print-memory-usage)
target_include_directories(fxlibctest PRIVATE include/)
target_link_libraries(fxlibctest JustUI::JustUI Gint::Gint -lc)
foreach(FOLDER IN LISTS FXLIBC_INSTALL)
target_include_directories(fxlibctest PRIVATE "${FOLDER}/include")
target_link_directories(fxlibctest PRIVATE "${FOLDER}/lib")
endforeach()
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
generate_g1a(TARGET fxlibctest OUTPUT "FxLibcT.g1a"
NAME "FxLibc test" ICON assets-fx/icon.png)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET fxlibctest OUTPUT "FxLibcT.g3a"
NAME "FxLibc test" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()