set(PHYSFS_ARCHIVE_ZIP $<NOT:$<BOOL:${ANDROID}>> CACHE INTERNAL "Enable ZIP support")
set(PHYSFS_ARCHIVE_7Z FALSE CACHE INTERNAL "Enable 7zip support")
set(PHYSFS_ARCHIVE_GRP FALSE CACHE INTERNAL "Enable Build Engine GRP support")
set(PHYSFS_ARCHIVE_WAD FALSE CACHE INTERNAL "Enable Doom WAD support")
set(PHYSFS_ARCHIVE_HOG FALSE CACHE INTERNAL "Enable Descent I/II HOG support")
set(PHYSFS_ARCHIVE_MVL FALSE CACHE INTERNAL "Enable Descent I/II MVL support")
set(PHYSFS_ARCHIVE_QPAK FALSE CACHE INTERNAL "Enable Quake I/II QPAK support")
set(PHYSFS_ARCHIVE_SLB FALSE CACHE INTERNAL "Enable I-War / Independence War SLB support")
set(PHYSFS_ARCHIVE_ISO9660 FALSE CACHE INTERNAL "Enable ISO9660 support")
set(PHYSFS_ARCHIVE_VDF FALSE CACHE INTERNAL "Enable Gothic I/II VDF archive support")
set(PHYSFS_BUILD_STATIC TRUE CACHE INTERNAL "Build static library")
set(PHYSFS_BUILD_SHARED FALSE CACHE INTERNAL "Build shared library")
set(PHYSFS_BUILD_TEST FALSE CACHE INTERNAL "Build stdio test program.")
add_subdirectory(${LOCAL_LIBRARY}/physfs EXCLUDE_FROM_ALL)

target_include_directories(physfs-static PUBLIC ${LOCAL_LIBRARY}/physfs/src)
target_link_libraries(rainbow physfs-static)
if(APPLE)
  find_library(FOUNDATION_LIBRARY Foundation REQUIRED)
  find_library(IOKIT_LIBRARY IOKit REQUIRED)
  target_link_libraries(rainbow ${IOKIT_LIBRARY} ${FOUNDATION_LIBRARY})
endif()
