gotc/CMakeLists.txt

38 lines
1.0 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.18)
project(gotc)
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
find_package(Gint 2.1 REQUIRED)
include_directories(include)
set(SOURCES
src/main.c
src/level.c
)
set(ASSETS)
set(ASSETS_fx)
set(ASSETS_cg)
set(FLAGS -Wall -Wextra -Werror -std=c11 -pedantic -Os)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(${PROJECT_NAME} ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(${PROJECT_NAME} PRIVATE ${FLAGS})
target_link_libraries(${PROJECT_NAME} Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
generate_g1a(TARGET ${PROJECT_NAME} OUTPUT "${PROJECT_NAME}.g1a"
NAME "${PROJECT_NAME}" ICON assets-fx/icon.png)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET ${PROJECT_NAME} OUTPUT "${PROJECT_NAME}.g3a"
NAME "${PROJECT_NAME}" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()