aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-08-22 10:13:47 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2017-08-22 10:07:20 +0000
commit549239f16dedd1511a153fcd2a716b6a92f155c8 (patch)
treeafc403db8aaf69a7c427249d70bad85dd265901c
parent98e41e45b4220de69bdb66e3c6560f8be0a4797c (diff)
Simplify export macro definition of the QML parser
We always want QML_PARSER_EXPORT to be empty. Enforce this by adding the necessary preprocessor macros directly in qmljsglobal_p.h. This removes the need to define QT_CREATOR and QML_BUILD_STATIC_LIB=1 in our project files. Also, we failed to do it correctly and always dllimported the QML parser's symbols. Change-Id: Ibecb2582546385c2067bd01edaba8694aa057e51 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/lib/corelib/corelib.pro1
-rw-r--r--src/lib/corelib/corelib.qbs1
-rw-r--r--src/lib/corelib/parser/qmljsglobal_p.h9
3 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/corelib/corelib.pro b/src/lib/corelib/corelib.pro
index 8e53891fd..c0026f14b 100644
--- a/src/lib/corelib/corelib.pro
+++ b/src/lib/corelib/corelib.pro
@@ -13,7 +13,6 @@ qbs_enable_project_file_updates: QT += gui
INCLUDEPATH += $$PWD
CONFIG += depend_includepath
-DEFINES += QT_CREATOR QML_BUILD_STATIC_LIB # needed for QmlJS
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/src/lib/corelib/corelib.qbs b/src/lib/corelib/corelib.qbs
index 8de80c8f4..439365d33 100644
--- a/src/lib/corelib/corelib.qbs
+++ b/src/lib/corelib/corelib.qbs
@@ -18,7 +18,6 @@ QbsLibrary {
cpp.defines: base.concat([
'QBS_RELATIVE_LIBEXEC_PATH="' + qbsbuildconfig.relativeLibexecPath + '"',
"QBS_VERSION=\"" + version + "\"",
- "QT_CREATOR", "QML_BUILD_STATIC_LIB", // needed for QmlJS
]).concat(projectFileUpdateDefines).concat(enableUnitTestsDefines)
Properties {
diff --git a/src/lib/corelib/parser/qmljsglobal_p.h b/src/lib/corelib/parser/qmljsglobal_p.h
index 5a875c01a..c3d198ea5 100644
--- a/src/lib/corelib/parser/qmljsglobal_p.h
+++ b/src/lib/corelib/parser/qmljsglobal_p.h
@@ -41,6 +41,15 @@
#include <QtCore/qglobal.h>
+// Force QML_PARSER_EXPORT to be always empty.
+#ifndef QT_CREATOR
+# define QT_CREATOR
+#endif
+#ifdef QML_BUILD_STATIC_LIB
+# undef QML_BUILD_STATIC_LIB
+#endif
+#define QML_BUILD_STATIC_LIB 1
+
#ifdef QT_CREATOR
# ifdef QMLJS_BUILD_DIR
# define QML_PARSER_EXPORT Q_DECL_EXPORT