mirror of https://git.sr.ht/~kikoodx/crystal-tower
48 lines
940 B
CMake
48 lines
940 B
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
|
|
)
|
|
|
|
set(LEVELS
|
|
lvl/test.kble
|
|
)
|
|
|
|
set(ASSETS
|
|
res/tileset.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 "${PROJECT_NAME}"
|
|
ICONS res/icon-uns.png res/icon-sel.png
|
|
)
|