winpr: add WINPR_DLL definition

This commit is contained in:
Marc-André Moreau
2017-02-15 14:50:24 -05:00
parent 8871d55589
commit 1b42e512ee
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__