fix symbol export/import

This commit is contained in:
SpaceIm 2022-01-30 18:00:45 +01:00
parent a0dfe220ff
commit 9fd930b385
2 changed files with 10 additions and 3 deletions

View File

@ -174,6 +174,7 @@ endif()
option(PHYSFS_BUILD_SHARED "Build shared library" TRUE) option(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
if(PHYSFS_BUILD_SHARED) if(PHYSFS_BUILD_SHARED)
add_library(physfs SHARED ${PHYSFS_SRCS}) add_library(physfs SHARED ${PHYSFS_SRCS})
target_compile_definitions(physfs PRIVATE PHYSFS_BUILD_SHARED PUBLIC PHYSFS_SHARED)
set_target_properties(physfs PROPERTIES MACOSX_RPATH 1) set_target_properties(physfs PROPERTIES MACOSX_RPATH 1)
set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION})

View File

@ -223,10 +223,13 @@
extern "C" { extern "C" {
#endif #endif
#if defined(PHYSFS_DECL) #ifdef PHYSFS_SHARED
/* do nothing. */ #ifdef _MSC_VER
#elif defined(_MSC_VER) #ifdef PHYSFS_BUILD_SHARED
#define PHYSFS_DECL __declspec(dllexport) #define PHYSFS_DECL __declspec(dllexport)
#else
#define PHYSFS_DECL __declspec(dllimport)
#endif
#elif defined(__SUNPRO_C) #elif defined(__SUNPRO_C)
#define PHYSFS_DECL __global #define PHYSFS_DECL __global
#elif ((__GNUC__ >= 3) && (!defined(__EMX__)) && (!defined(sun))) #elif ((__GNUC__ >= 3) && (!defined(__EMX__)) && (!defined(sun)))
@ -234,6 +237,9 @@ extern "C" {
#else #else
#define PHYSFS_DECL #define PHYSFS_DECL
#endif #endif
#else
#define PHYSFS_DECL
#endif
#if defined(PHYSFS_DEPRECATED) #if defined(PHYSFS_DEPRECATED)
/* do nothing. */ /* do nothing. */