tiny_link/CMakeLists.txt

61 lines
1.5 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.12)
2021-01-02 09:43:43 +08:00
project(TinyLink)
# C++ version
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#include blah
add_subdirectory(libs/blah)
# add our source
add_executable(game
2021-01-03 05:51:50 +08:00
src/main.cpp
2021-01-03 08:20:01 +08:00
src/world.h
2021-01-02 11:47:19 +08:00
src/world.cpp
2021-01-03 08:20:01 +08:00
src/game.h
2021-01-03 05:51:50 +08:00
src/game.cpp
2021-01-03 08:20:01 +08:00
src/content.h
2021-01-03 05:51:50 +08:00
src/content.cpp
2021-01-04 10:55:56 +08:00
src/masks.h
src/factory.h
src/factory.cpp
2021-01-03 08:20:01 +08:00
src/assets/sprite.h
src/assets/sprite.cpp
2021-01-04 10:55:56 +08:00
src/assets/tileset.h
src/assets/tileset.cpp
2021-01-03 08:20:01 +08:00
src/components/animator.h
src/components/animator.cpp
src/components/collider.h
src/components/collider.cpp
src/components/player.h
src/components/player.cpp
src/components/mover.h
src/components/mover.cpp
2021-01-04 10:55:56 +08:00
src/components/tilemap.h
src/components/tilemap.cpp
src/components/hurtable.h
src/components/hurtable.cpp
src/components/timer.h
src/components/timer.cpp
src/components/enemy.h
2021-01-04 13:42:45 +08:00
"src/components/ghost_frog.h" "src/components/ghost_frog.cpp" "src/components/orb.h" "src/components/orb.cpp")
2021-01-02 09:43:43 +08:00
# Reference blah
target_link_libraries(game blah)
2021-01-04 17:22:39 +08:00
if( ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
set_target_properties(game PROPERTIES LINK_FLAGS "-s USE_SDL=2 -s USE_WEBGL2=1 --preload-file ${CMAKE_SOURCE_DIR}/content@/content")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()
2021-01-02 09:43:43 +08:00
# copy SDL2 to the build directory
set(SDL2_DLL "" CACHE FILEPATH "SDL2 DLL Path")
if (SDL2_ENABLED)
2021-01-03 10:46:20 +08:00
if (EXISTS ${SDL2_DLL})
add_custom_command(
TARGET game POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} $<TARGET_FILE_DIR:game>)
endif()
endif()