From a5bd24845a2720d57a66d81effc59423d723c87c Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Tue, 5 May 2015 19:23:45 -0400 Subject: ICE-6481 pragma comment when building static libraries On windows with VS, pragma comment is now defined when building only when ICE_BUILDING_ is not defined. ICE_BUILDING_ is defined automatically when _API_EXPORTS is defined. When building static Ice libraries on Windows, please define ICE_BUILDING_. ICE_DECLSPEC_EXPORT and ICE_DECLSPEC_IMPORT are now defined all the time on Windows, and we define the various _API macros to /**/ when ICE_STATIC_LIBS is defined. Replaced various direct use of ICE_DECLSPEC_EXPORT/ICE_DECLSPEC_IMPORT by the correct _API macro. --- cpp/include/Slice/Parser.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cpp/include/Slice/Parser.h') diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index 257e1df5987..2ca3e84bfc4 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -23,11 +23,14 @@ // // Automatically link Slice[D].lib with Visual C++ // -#if defined(_MSC_VER) && !defined(ICE_NO_PRAGMA_COMMENT) -# if defined(ICE_STATIC_LIBS) -# pragma comment(lib, "Slice.lib") -# elif !defined(SLICE_API_EXPORTS) -# if defined(_DEBUG) + +#if !defined(ICE_BUILDING_SLICE) && defined(SLICE_API_EXPORTS) +# define ICE_BUILDING_SLICE +#endif + +#if defined(_MSC_VER) +# if !defined(ICE_BUILDING_SLICE) +# if defined(_DEBUG) && !defined(ICE_OS_WINRT) # pragma comment(lib, "SliceD.lib") # else # pragma comment(lib, "Slice.lib") @@ -38,6 +41,8 @@ #ifndef SLICE_API # ifdef SLICE_API_EXPORTS # define SLICE_API ICE_DECLSPEC_EXPORT +# elif defined(ICE_STATIC_LIBS) +# define SLICE_API /**/ # else # define SLICE_API ICE_DECLSPEC_IMPORT # endif -- cgit v1.2.3