summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Schuh <andreas.schuh.84@gmail.com>2014-03-25 15:29:56 +0000
committerAndreas Schuh <andreas.schuh.84@gmail.com>2014-03-25 15:30:37 +0000
commit6040eac5b35763d94af5a0cf6aff75d84f0129b6 (patch)
treeec5d4ca3ed62f465355989c54edd407370337ac8 /CMakeLists.txt
parent3fd9fa7000197330f562949612bc5cd6ee67bd7d (diff)
downloadgflags-6040eac5b35763d94af5a0cf6aff75d84f0129b6.tar.gz
gflags-6040eac5b35763d94af5a0cf6aff75d84f0129b6.tar.bz2
gflags-6040eac5b35763d94af5a0cf6aff75d84f0129b6.zip
Use GFLAGS_IS_A_DLL=1 in public headers if BUILD_SHARED_LIBS is enabled (Fixes issue #77).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ed3161..4702485 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})