mirror of https://git.sr.ht/~kikoodx/crystal-tower
70 lines
1.2 KiB
CMake
70 lines
1.2 KiB
CMake
# Configure with [fxsdk build-cg], which provide the
|
|
# toolchain file and module path of the fxSDK
|
|
|
|
cmake_minimum_required(VERSION 3.18)
|
|
project(CRYSTAL C)
|
|
|
|
include(GenerateG3A)
|
|
include(Fxconv)
|
|
|
|
find_package(Gint 2.6.0 REQUIRED)
|
|
|
|
include_directories(inc)
|
|
|
|
set(SOURCES
|
|
src/main.c
|
|
src/input.c
|
|
src/level.c
|
|
src/player.c
|
|
src/util.c
|
|
src/camera.c
|
|
src/anim.c
|
|
src/shatter.c
|
|
src/particles.c
|
|
src/stars.c
|
|
src/results.c
|
|
)
|
|
|
|
set(LEVELS
|
|
lvl/0.kble
|
|
lvl/1.kble
|
|
lvl/2.kble
|
|
lvl/3.kble
|
|
lvl/4.kble
|
|
lvl/5.kble
|
|
lvl/6.kble
|
|
lvl/7.kble
|
|
lvl/8.kble
|
|
lvl/9.kble
|
|
lvl/end.kble
|
|
)
|
|
|
|
set(ASSETS
|
|
res/tileset.png
|
|
res/shatter.png
|
|
res/player.png
|
|
res/title.png
|
|
res/font.png
|
|
${LEVELS}
|
|
)
|
|
|
|
set(FLAGS
|
|
-Wall -Wextra -Wshadow -Wswitch-default -Wswitch-enum
|
|
-Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes
|
|
-Wold-style-definition -Werror-implicit-function-declaration
|
|
-std=c11 -O3
|
|
)
|
|
|
|
fxconv_declare_assets(${ASSETS} WITH_METADATA)
|
|
|
|
add_executable(target ${SOURCES} ${ASSETS})
|
|
target_compile_options(target PRIVATE ${FLAGS})
|
|
target_link_libraries(target Gint::Gint)
|
|
target_link_options(target PRIVATE -Wl,-Map=map)
|
|
|
|
generate_g3a(TARGET target
|
|
OUTPUT "${PROJECT_NAME}.g3a"
|
|
NAME ""
|
|
ICONS res/icon-uns.png res/icon-sel.png
|
|
)
|