From 09f7800768f8cc02ecaff4fdb020c195ba4d363a Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Tue, 25 Mar 2014 15:29:56 +0000 Subject: [PATCH] Use GFLAGS_IS_A_DLL=1 in public headers if BUILD_SHARED_LIBS is enabled (Fixes issue #77). --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d3a73..7ada98c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,15 @@ else () set (GFLAGS_ATTRIBUTE_UNUSED) endif () +# whenever we build a shared library (DLL on Windows), configure the public +# headers of the API for use of this library rather than the optionally +# also build statically linked library; users can override GFLAGS_DLL_DECL +if (BUILD_SHARED_LIBS) + set (GFLAGS_IS_A_DLL 1) +else () + set (GFLAGS_IS_A_DLL 0) +endif () + configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS}) configure_sources (PRIVATE_HDRS ${PRIVATE_HDRS}) configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS}) -- 2.7.4