64 lines
1.6 KiB
CMake
64 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.18)
|
|
project(Windmill)
|
|
|
|
include(GenerateG1A)
|
|
include(GenerateG3A)
|
|
include(Fxconv)
|
|
find_package(Gint 2.1 REQUIRED)
|
|
|
|
set(SOURCES
|
|
src/main.cpp
|
|
src/windmill.cpp
|
|
src/map.cpp
|
|
src/scene_map.cpp
|
|
src/camera.cpp
|
|
src/game.cpp
|
|
src/player.cpp
|
|
# ...
|
|
)
|
|
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
|
|
set(ASSETS
|
|
# ...
|
|
)
|
|
set(ASSETS_fx
|
|
assets-fx/example.png
|
|
assets-fx/img/windmill.png
|
|
# ...
|
|
)
|
|
set(ASSETS_cg
|
|
assets-cg/example.png
|
|
# ...
|
|
)
|
|
|
|
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
|
|
|
|
set_source_files_properties(src/map.cpp PROPERTIES
|
|
COMPILE_OPTIONS "-Wp,-w;-Wno-missing-field-initializers")
|
|
|
|
add_executable(${PROJECT_NAME} ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE "${FXSDK_COMPILER_INSTALL}/include/openlibm")
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Os -fno-use-cxa-atexit)
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE -Wl,-Map=map)
|
|
|
|
target_link_libraries(${PROJECT_NAME} Gint::Gint -lopenlibm -lc -lsupc++)
|
|
|
|
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()
|