Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ find_package(SDL3 REQUIRED)
find_package(PhysFS REQUIRED)

# SDL_physfs_test
add_executable(SDL_PhysFS_Test SDL_PhysFS_Test.c)
add_executable(SDL_PhysFS_Test
SDL_PhysFS_Test.c
)
target_compile_options(SDL_PhysFS_Test PRIVATE
$<$<NOT:$<C_COMPILER_ID:MSVC>>:-Wall;-Wextra;-Wconversion;-Wsign-conversion>
$<$<C_COMPILER_ID:MSVC>:/W4>
Expand Down
5 changes: 1 addition & 4 deletions test/SDL_PhysFS_Test.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(int argc, char* argv[]) {
size_t zipSize;
void* zipData = SDL_PhysFS_LoadFile("res/test.zip", &zipSize);
SDL_assert(zipData != NULL);
SDL_assert(SDL_PhysFS_MountFromMemory((const unsigned char*)zipData, (int)zipSize, "test.zip", "zip"));
SDL_assert(SDL_PhysFS_MountFromMemory((const unsigned char*)zipData, zipSize, "test.zip", "zip"));
SDL_assert(SDL_PhysFS_Exists("zip/test.txt"));
{
size_t size;
Expand Down Expand Up @@ -125,9 +125,6 @@ int main(int argc, char* argv[]) {
SDL_assert(SDL_PhysFS_IOStatus(PHYSFS_ERR_OUT_OF_MEMORY) == SDL_IO_STATUS_NOT_READY);
SDL_assert(SDL_PhysFS_IOStatus(PHYSFS_ERR_IO) == SDL_IO_STATUS_ERROR);

// No lingering errors before unmount
SDL_assert(strlen(SDL_GetError()) == 0);

// SDL_PhysFS_Unmount
SDL_assert(SDL_PhysFS_Unmount("resources") == true);

Expand Down
9 changes: 5 additions & 4 deletions test/cmake/FindPhysFS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ set(PHYSFS_ARCHIVE_SLB OFF CACHE BOOL "" FORCE)
set(PHYSFS_ARCHIVE_ISO9660 OFF CACHE BOOL "" FORCE)
set(PHYSFS_ARCHIVE_VDF OFF CACHE BOOL "" FORCE)

# Platform: Force use of the PhysFS SDL3 Platform
set(PHYSFS_PLATFORM_SDL3 ON CACHE BOOL "" FORCE)

# library options
set(PHYSFS_BUILD_STATIC ON CACHE BOOL "" FORCE)
set(PHYSFS_BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(PHYSFS_BUILD_TEST OFF CACHE BOOL "" FORCE)
set(PHYSFS_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(PHYSFS_DISABLE_INSTALL ON CACHE BOOL "" FORCE)
set(PHYSFS_DISABLE_UNINSTALL ON CACHE BOOL "" FORCE)

set(PHYSFS_INSTALL OFF CACHE BOOL "" FORCE)
include(FetchContent)
FetchContent_Declare(
physfs
GIT_REPOSITORY https://github.com/icculus/physfs.git
GIT_TAG a555824
GIT_TAG 5f73e95
)
FetchContent_MakeAvailable(physfs)
include_directories(${physfs_SOURCE_DIR}/src)
Loading