From 620220413e7b5d838fca1e56a0dc3a3a7135dcba Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 19 Dec 2021 18:37:19 +0100 Subject: [PATCH] CMake: don't treat Q_CORE_EXPORT special Let CMake create a qtcoreexports.h just like for every other Qt library, include it in a fitting place in qglobal.h. Currently, that's in the middle of the file, but that will be cleaned up in subsequent commits. Task-number: QTBUG-99313 Change-Id: I3ea9f4772b0ad63c7e8431689146cac3336c5ccf Reviewed-by: Joerg Bornemann Reviewed-by: Alexey Edelev --- src/corelib/CMakeLists.txt | 1 + src/corelib/global/qglobal.h | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 915a7ae08c..c1259150ab 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -266,6 +266,7 @@ qt_internal_add_module(Core Qt::GlobalConfigPrivate # special case PRECOMPILED_HEADER "global/qt_pch.h" + GENERATE_CPP_EXPORTS PUBLIC_LIBRARIES # special case: Qt::Platform # special case: # special case begin diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0ec3bbcb85..e44929b379 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -516,15 +516,12 @@ constexpr inline Deprecated_t Deprecated = {}; # ifndef QT_SHARED # define QT_SHARED # endif -# if defined(QT_BUILD_CORE_LIB) -# define Q_CORE_EXPORT Q_DECL_EXPORT -# else -# define Q_CORE_EXPORT Q_DECL_IMPORT -# endif -#else -# define Q_CORE_EXPORT #endif +QT_BEGIN_INCLUDE_NAMESPACE +#include +QT_END_INCLUDE_NAMESPACE + /* Some classes do not permit copies to be made of an object. These classes contains a private copy constructor and assignment