Merge pull request #4914 from Devolutions/winpr-dll-export

Add WINPR_DLL definition to control WinPR symbol exporting
This commit is contained in:
Marc-André Moreau 2018-10-16 09:09:05 -04:00 committed by GitHub
commit ce234411c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -1037,6 +1037,10 @@ else()
set(PRIVATE_KEYWORD "PRIVATE")
endif()
if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_DLL")
endif()
add_subdirectory(winpr)
# Sub-directories

View File

@ -158,6 +158,10 @@ if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_DLL")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_EXPORTS")
# Enable 64bit file support on linux and FreeBSD.

View File

@ -21,6 +21,7 @@
#include <winpr/platform.h>
#ifdef WINPR_DLL
#if defined _WIN32 || defined __CYGWIN__
#ifdef WINPR_EXPORTS
#ifdef __GNUC__
@ -42,6 +43,9 @@
#define WINPR_API
#endif
#endif
#else /* WINPR_DLL */
#define WINPR_API
#endif
/* Thread local storage keyword define */
#if defined _WIN32 || defined __CYGWIN__