From a261c59b231b001b80502d530f4d8c6aed9eefa2 Mon Sep 17 00:00:00 2001 From: kiibimees <93144752+kiibimees@users.noreply.github.com> Date: Sat, 13 Aug 2022 12:12:32 +0300 Subject: [PATCH] [qt] Don't add import/export when building inside Qt plugin. (#394) (#395) [qt] Do not add import/export into headers when building inside Qt plugin. (#394) Co-authored-by: Tadej Novak --- platform/qt/qt.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 13ebea8b8..426362f9b 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -280,12 +280,19 @@ if (MBGL_QT_STATIC AND NOT MBGL_QT_INSIDE_PLUGIN) $<$>:Qt${QT_VERSION_MAJOR}::Sql> $<$,$>>:z> ) +endif() + +if (MBGL_QT_STATIC OR MBGL_QT_INSIDE_PLUGIN) + # Don't add import/export into public header because we don't build shared library. + # In case on MBGL_QT_INSIDE_PLUGIN it's always OBJECT library and bundled into one + # single Qt plugin lib. target_compile_definitions( qmaplibregl PUBLIC QT_MAPLIBREGL_STATIC ) endif() + install(TARGETS qmaplibregl EXPORT QMapLibreGLTargets # Explicit set of DESTINATION is needed for older CMake versions.