summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2021-01-17 18:31:19 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2021-03-01 21:37:34 +0000
commitce1fcd4352f920a59d965310440be18ff48acb8f (patch)
tree63eade90c9942eb9da6e6e526941c5723ef95ef9 /cpp
parentd1e5c5b29214d82f43eb72d51b2df5184fcbbe33 (diff)
Hide symbols by default
Use cmake for better import/export defines
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CMakeLists.txt2
-rw-r--r--cpp/poppler-global.h14
2 files changed, 3 insertions, 13 deletions
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 5d351979..c37936b6 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -25,6 +25,7 @@ set(poppler_cpp_SRCS
)
add_library(poppler-cpp ${poppler_cpp_SRCS})
+generate_export_header(poppler-cpp BASE_NAME poppler-cpp EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/poppler_cpp_export.h")
set_target_properties(poppler-cpp PROPERTIES VERSION 0.9.0 SOVERSION 0)
if(MINGW AND BUILD_SHARED_LIBS)
get_target_property(POPPLER_CPP_SOVERSION poppler-cpp SOVERSION)
@@ -46,6 +47,7 @@ install(FILES
poppler-page-transition.h
poppler-rectangle.h
poppler-toc.h
+ ${CMAKE_CURRENT_BINARY_DIR}/poppler_cpp_export.h
${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h
DESTINATION include/poppler/cpp)
diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h
index 1ae63bda..bdc12beb 100644
--- a/cpp/poppler-global.h
+++ b/cpp/poppler-global.h
@@ -22,19 +22,7 @@
#ifndef POPPLER_GLOBAL_H
#define POPPLER_GLOBAL_H
-#if defined(_WIN32)
-# define LIB_EXPORT __declspec(dllexport)
-# define LIB_IMPORT __declspec(dllimport)
-#else
-# define LIB_EXPORT
-# define LIB_IMPORT
-#endif
-
-#if defined(poppler_cpp_EXPORTS)
-# define POPPLER_CPP_EXPORT LIB_EXPORT
-#else
-# define POPPLER_CPP_EXPORT LIB_IMPORT
-#endif
+#include "poppler_cpp_export.h"
#include <iosfwd>
#include <string>