CMakeLists.txt (1076B)
1 cmake_minimum_required(VERSION 3.16) 2 project(fangflecked) 3 4 # set the output directory for built objects. 5 # This makes sure that the dynamic library goes into the build directory automatically. 6 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>") 7 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>") 8 9 # This assumes the SDL source is available in vendored/SDL 10 add_subdirectory(vendored/SDL EXCLUDE_FROM_ALL) 11 12 # Create your game executable target as usual 13 add_executable(ff fangflecked.c) 14 15 # Embed assets if compiling for web 16 if(EMSCRIPTEN) 17 set_target_properties(ff PROPERTIES LINK_FLAGS "--embed-file ../assets/d1warriorstand.bmp@assets/d1warriorstand.bmp --embed-file ../assets/d1warriorwalk.bmp@assets/d1warriorwalk.bmp --embed-file ../assets/ph_tile.bmp@assets/ph_tile.bmp --embed-file ../assets/ph_tile2.bmp@assets/ph_tile2.bmp --embed-file ../assets/ph_tile3.bmp@assets/ph_tile3.bmp") 18 endif() 19 20 # Link to the actual SDL3 library. 21 target_link_libraries(ff PRIVATE SDL3::SDL3) 22 target_compile_options(ff PRIVATE -std=c89 -Wall)