A 2D tile-based sandbox game.
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.

CMakeLists.txt 986B

1234567891011121314151617181920212223242526
  1. cmake_minimum_required(VERSION 2.8)
  2. project(swan)
  3. find_package(SFML 2.5 COMPONENTS graphics system window REQUIRED)
  4. add_compile_options(-std=c++17 -Wall -Wextra -Wpedantic -Wno-unused-parameter)
  5. if(CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL "")
  6. message(STATUS "Build mode: Debug")
  7. add_compile_options(-g -fsanitize=address)
  8. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
  9. elseif(CMAKE_BUILD_TYPE STREQUAL Release)
  10. message(STATUS "Build mode: Release")
  11. add_compile_options(-O3 -flto)
  12. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
  13. else()
  14. message(FATAL_ERROR "CMAKE_BUILD_TYPE must be Debug or Release.")
  15. endif()
  16. include_directories("${PROJECT_SOURCE_DIR}/libswan/include" "${PROJECT_SOURCE_DIR}/third_party")
  17. add_subdirectory(libswan)
  18. add_subdirectory(core.mod)
  19. add_executable(swan src/main.cc)
  20. target_link_libraries(swan libswan sfml-graphics sfml-system sfml-window sfml-audio dl)
  21. file(COPY assets DESTINATION .)