2021-06-11 01:32:47 +02:00
|
|
|
# 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(RC C)
|
|
|
|
|
|
|
|
include(GenerateG3A)
|
|
|
|
include(Fxconv)
|
|
|
|
|
|
|
|
find_package(Gint 2.5.3 REQUIRED)
|
|
|
|
find_package(LibImg 2.4.0 REQUIRED)
|
|
|
|
|
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
src/main.c
|
|
|
|
src/entity/collide.c
|
|
|
|
src/entity/draw_hitbox.c
|
|
|
|
src/entity/init.c
|
2021-06-11 12:47:16 +02:00
|
|
|
src/entity/move.c
|
2021-06-11 01:32:47 +02:00
|
|
|
src/wall/init.c
|
2021-06-11 13:53:22 +02:00
|
|
|
src/player/update.c
|
2021-06-11 01:32:47 +02:00
|
|
|
src/player/init.c
|
2021-06-11 12:47:16 +02:00
|
|
|
src/util.c
|
2021-06-11 01:32:47 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSETS
|
|
|
|
)
|
|
|
|
|
|
|
|
set(FLAGS
|
|
|
|
-Wall -Wextra -Wshadow -Wswitch-default -Wswitch-enum
|
|
|
|
-Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
-Wold-style-definition -Werror-implicit-function-declaration
|
2021-06-11 12:47:16 +02:00
|
|
|
-fplan9-extensions -std=c99 -O3
|
2021-06-11 01:32:47 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
fxconv_declare_assets(${ASSETS} WITH_METADATA)
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${SOURCES} ${ASSETS})
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE ${FLAGS})
|
|
|
|
target_link_libraries(${PROJECT_NAME} Gint::Gint)
|
|
|
|
target_link_libraries(${PROJECT_NAME} LibImg::LibImg)
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE -Wl,-Map=map)
|
|
|
|
|
|
|
|
generate_g3a(TARGET ${PROJECT_NAME}
|
|
|
|
OUTPUT "${PROJECT_NAME}.g3a"
|
|
|
|
NAME "${PROJECT_NAME}"
|
|
|
|
ICONS assets/graphics/icon-uns.png assets/graphics/icon-sel.png)
|