2022-05-03 18:53:24 +02:00
|
|
|
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
|
|
|
|
2020-09-29 13:47:50 +02:00
|
|
|
project(filesystem_service CXX)
|
|
|
|
|
|
|
|
add_library(filesystem_service
|
|
|
|
src/mm/path_utils.hpp
|
|
|
|
|
|
|
|
src/mm/services/filesystem.hpp
|
|
|
|
src/mm/services/filesystem.cpp
|
|
|
|
|
|
|
|
src/mm/fs_const_archiver.hpp
|
|
|
|
src/mm/fs_const_archiver.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(filesystem_service PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
|
|
|
2022-10-30 16:36:17 +01:00
|
|
|
target_link_libraries(filesystem_service PUBLIC
|
2020-09-29 13:47:50 +02:00
|
|
|
engine
|
|
|
|
logger
|
|
|
|
entt
|
|
|
|
nlohmann_json::nlohmann_json
|
|
|
|
physfs-static # TODO: fix this
|
|
|
|
std_utils
|
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT MM_HEADLESS)
|
|
|
|
|
|
|
|
#if android
|
|
|
|
#target_link_libraries(filesystem_service SDL)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if(EMSCRIPTEN)
|
2022-10-30 16:36:17 +01:00
|
|
|
target_compile_options(filesystem_service PUBLIC -sUSE_SDL=2)
|
|
|
|
target_link_libraries(filesystem_service PUBLIC -sUSE_SDL=2)
|
2021-11-30 19:50:40 +01:00
|
|
|
elseif(VCPKG_TARGET_TRIPLET)
|
2022-10-31 22:35:55 +01:00
|
|
|
find_package(SDL2 CONFIG REQUIRED)
|
|
|
|
|
2022-10-30 16:36:17 +01:00
|
|
|
target_link_libraries(filesystem_service
|
|
|
|
PUBLIC
|
|
|
|
SDL2::SDL2
|
2022-11-01 15:41:41 +01:00
|
|
|
SDL2::SDL2main
|
2022-10-31 22:35:55 +01:00
|
|
|
#SDL2::SDL2-static
|
2022-10-30 16:36:17 +01:00
|
|
|
)
|
2020-09-29 13:47:50 +02:00
|
|
|
else()
|
|
|
|
#if not android or emscripten
|
2022-10-31 22:35:55 +01:00
|
|
|
find_package(SDL2 REQUIRED)
|
2020-09-29 13:47:50 +02:00
|
|
|
target_include_directories(filesystem_service PUBLIC "${SDL2_INCLUDE_DIR}")
|
2022-10-30 16:36:17 +01:00
|
|
|
target_link_libraries(filesystem_service PUBLIC ${SDL2_LIBRARY})
|
2020-09-29 13:47:50 +02:00
|
|
|
#endif
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_TESTING)
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
|
|
|
|