|
|
@@ -24,6 +24,8 @@ include("${PROJECT_SOURCE_DIR}/cmake/sdlmanpages.cmake")
|
|
|
# Increment this if/when we break backwards compatibility.
|
|
|
set(PHYSFS_SOVERSION 1)
|
|
|
|
|
|
+set(PC_PRIVATE_REQUIRES "")
|
|
|
+
|
|
|
set(PHYSFS_M_SRCS)
|
|
|
set(PHYSFS_CPP_SRCS)
|
|
|
|
|
|
@@ -196,8 +198,8 @@ endif()
|
|
|
|
|
|
option(PHYSFS_PLATFORM_SDL3 "Enable building for the SDL3 file system" FALSE)
|
|
|
if(PHYSFS_PLATFORM_SDL3)
|
|
|
- find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
|
|
- add_definitions(-DPHYSFS_PLATFORM_SDL3=1)
|
|
|
+ find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS Headers SDL3)
|
|
|
+ list(APPEND PC_PRIVATE_REQUIRES "sdl3")
|
|
|
endif()
|
|
|
|
|
|
if(EMSCRIPTEN)
|
|
|
@@ -230,6 +232,7 @@ if(PHYSFS_BUILD_STATIC)
|
|
|
target_compile_definitions(physfs-static PRIVATE "PHYSFS_STATIC")
|
|
|
endif()
|
|
|
if(PHYSFS_PLATFORM_SDL3)
|
|
|
+ target_compile_definitions(physfs-static PRIVATE PHYSFS_PLATFORM_SDL3=1)
|
|
|
target_link_libraries(physfs-static PUBLIC SDL3::Headers)
|
|
|
endif()
|
|
|
target_include_directories(physfs-static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
|
|
|
@@ -260,7 +263,9 @@ if(PHYSFS_BUILD_SHARED)
|
|
|
set_property(TARGET physfs-shared PROPERTY VS_WINRT_COMPONENT TRUE)
|
|
|
endif()
|
|
|
if(PHYSFS_PLATFORM_SDL3)
|
|
|
- target_link_libraries(physfs-shared PUBLIC SDL3::SDL3-shared)
|
|
|
+ target_compile_definitions(physfs-shared PRIVATE PHYSFS_PLATFORM_SDL3=1)
|
|
|
+ target_link_libraries(physfs-shared PUBLIC SDL3::Headers)
|
|
|
+ target_link_libraries(physfs-shared PRIVATE SDL3::SDL3-shared)
|
|
|
endif()
|
|
|
target_include_directories(physfs-shared PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
|
|
|
target_link_libraries(physfs-shared PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
|
|
|
@@ -283,9 +288,6 @@ if(PHYSFS_BUILD_TEST)
|
|
|
add_executable(test_physfs test/test_physfs.c)
|
|
|
target_link_libraries(test_physfs PRIVATE PhysFS::PhysFS)
|
|
|
sdl_add_warning_options(test_physfs WARNING_AS_ERROR ${PHYSFS_WERROR})
|
|
|
- if(PHYSFS_PLATFORM_SDL3)
|
|
|
- target_link_libraries(test_physfs PRIVATE SDL3::SDL3)
|
|
|
- endif()
|
|
|
if(DOS)
|
|
|
set_target_properties(test_physfs PROPERTIES OUTPUT_NAME "TESTPHYS") # 8.3 file names!
|
|
|
endif()
|
|
|
@@ -305,9 +307,6 @@ if(PHYSFS_BUILD_TEST)
|
|
|
if(UNIX)
|
|
|
add_executable(physfshttpd extras/physfshttpd.c)
|
|
|
target_link_libraries(physfshttpd PRIVATE PhysFS::PhysFS)
|
|
|
- if(PHYSFS_PLATFORM_SDL3)
|
|
|
- target_link_libraries(physfshttpd PRIVATE SDL3::SDL3)
|
|
|
- endif()
|
|
|
sdl_add_warning_options(physfshttpd WARNING_AS_ERROR ${PHYSFS_WERROR})
|
|
|
endif()
|
|
|
endif()
|
|
|
@@ -375,6 +374,7 @@ if(PHYSFS_INSTALL)
|
|
|
install(FILES LICENSE.txt
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/PhysicsFS${PROJECT_VERSION_MAJOR}")
|
|
|
|
|
|
+ string(REPLACE ";" " " PC_PRIVATE_REQUIRES "${PC_PRIVATE_REQUIRES}")
|
|
|
configure_file(cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake IMMEDIATE @ONLY)
|
|
|
add_custom_target(uninstall-physfs
|
|
|
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
|
|
@@ -450,6 +450,7 @@ message_bool_option("VDF support" PHYSFS_ARCHIVE_VDF)
|
|
|
message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
|
|
|
message_bool_option("GOB/LAB/LFD support" PHYSFS_ARCHIVE_LECARCHIVES)
|
|
|
message_bool_option("POD support" PHYSFS_ARCHIVE_POD)
|
|
|
+message_bool_option("SDL3 filesystem support" PHYSFS_PLATFORM_SDL3)
|
|
|
message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
|
|
|
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
|
|
|
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
|