|
|
@@ -27,6 +27,8 @@ set(PHYSFS_SOVERSION 1)
|
|
|
set(PHYSFS_M_SRCS)
|
|
|
set(PHYSFS_CPP_SRCS)
|
|
|
|
|
|
+option(PHYSFS_WERROR "Treat warnings as errors" OFF)
|
|
|
+
|
|
|
if(WIN32)
|
|
|
list(APPEND OPTIONAL_LIBRARY_LIBS advapi32 shell32)
|
|
|
endif()
|
|
|
@@ -179,6 +181,7 @@ option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
|
|
|
if(PHYSFS_BUILD_STATIC)
|
|
|
add_library(physfs-static STATIC ${PHYSFS_SRCS})
|
|
|
add_library(PhysFS::PhysFS-static ALIAS physfs-static)
|
|
|
+ sdl_add_warning_options(physfs-static WARNING_AS_ERROR ${PHYSFS_WERROR})
|
|
|
set_property(TARGET physfs-static PROPERTY EXPORT_NAME PhysFS-static)
|
|
|
# Don't rename this on Windows, since DLLs will also produce an import
|
|
|
# library named "physfs.lib" which would conflict; Unix tend to like the
|
|
|
@@ -205,6 +208,7 @@ option(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
|
|
|
if(PHYSFS_BUILD_SHARED)
|
|
|
add_library(physfs-shared SHARED ${PHYSFS_SRCS})
|
|
|
add_library(PhysFS::PhysFS-shared ALIAS physfs-shared)
|
|
|
+ sdl_add_warning_options(physfs-shared WARNING_AS_ERROR ${PHYSFS_WERROR})
|
|
|
set_property(TARGET physfs-shared PROPERTY OUTPUT_NAME "physfs")
|
|
|
set_property(TARGET physfs-shared PROPERTY MACOSX_RPATH 1)
|
|
|
set_property(TARGET physfs-shared PROPERTY VERSION ${PHYSFS_VERSION})
|
|
|
@@ -239,6 +243,7 @@ mark_as_advanced(PHYSFS_BUILD_TEST)
|
|
|
if(PHYSFS_BUILD_TEST)
|
|
|
add_executable(test_physfs test/test_physfs.c)
|
|
|
target_link_libraries(test_physfs PRIVATE PhysFS::PhysFS ${OTHER_LDFLAGS})
|
|
|
+ sdl_add_warning_options(test_physfs WARNING_AS_ERROR ${PHYSFS_WERROR})
|
|
|
|
|
|
find_path(READLINE_H readline/readline.h)
|
|
|
find_path(HISTORY_H readline/history.h)
|