You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. # Setup the project and settings
  2. project(games)
  3. # Get the source toegher
  4. file(GLOB sources *.c)
  5. set(OUTPUT_EXT)
  6. if(${PLATFORM} MATCHES "Web")
  7. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1")
  8. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html")
  9. set(OUTPUT_EXT ".html")
  10. # Remove the -rdynamic flag because otherwise emscripten
  11. # does not generate HTML+JS+WASM files, only a non-working
  12. # and fat HTML
  13. string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
  14. endif()
  15. if (NOT TARGET raylib)
  16. find_package(raylib 2.0 REQUIRED)
  17. endif()
  18. # Do each game
  19. foreach(game_source ${sources})
  20. # Create the basename for the game
  21. get_filename_component(game_name ${game_source} NAME)
  22. string(REPLACE ".c" "${OUTPUT_EXT}" game_name ${game_name})
  23. # Setup the game
  24. add_executable(${game_name} ${game_source})
  25. # Link the libraries
  26. target_link_libraries(${game_name} raylib)
  27. endforeach()
  28. # Do the games with subdirectories
  29. add_subdirectory(drturtle)
  30. add_subdirectory(just_do)
  31. add_subdirectory(koala_seasons)
  32. add_subdirectory(light_my_ritual)
  33. add_subdirectory(skully_escape)
  34. add_subdirectory(wave_collector)