# 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.5 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/flog.c src/widgets/gscreen.c # ctype src/ctype/charprops.c src/ctype/classes.c src/ctype/convert.c # inttypes src/inttypes/functions.c src/inttypes/sizes.c # setjmp src/setjmp/massive.c src/setjmp/simple.c # stdlib src/stdlib/arith.c src/stdlib/fpconv.c src/stdlib/intconv.c src/stdlib/sizes.c # string src/string/core.c src/string/memarray.c src/string/misc.c src/string/naive.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 -fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/src/=) 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) 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()