From 2ba93a4719272c7da5cddf2d4867bf5732cf8f11 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 7 Jun 2018 14:41:53 +0200 Subject: Fix Windows build with QtScript-less Qt As we're building our own QtScript statically, we must override the export macros of QtScript. Change-Id: I9395e59cfcc1905b7b248b81277ec5fcfed9059f Reviewed-by: Christian Kandeler --- src/lib/corelib/corelib.qbs | 4 +- .../scriptengine/include/QtScript/qtscriptglobal.h | 46 ++++++++++++++++++++++ src/lib/scriptengine/scriptengine.pro | 1 + src/lib/scriptengine/scriptengine.qbs | 11 +++++- src/lib/scriptengine/use_scriptengine.pri | 1 + 5 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 src/lib/scriptengine/include/QtScript/qtscriptglobal.h diff --git a/src/lib/corelib/corelib.qbs b/src/lib/corelib/corelib.qbs index fd25d30e0..08733b624 100644 --- a/src/lib/corelib/corelib.qbs +++ b/src/lib/corelib/corelib.qbs @@ -17,7 +17,9 @@ QbsLibrary { Depends { condition: qbsbuildconfig.enableProjectFileUpdates; name: "Qt.gui" } Depends { condition: staticBuild; productTypes: ["qbsplugin"] } name: "qbscore" - cpp.includePaths: base.concat([ + property stringList bundledQtScriptIncludes: qbsbuildconfig.useBundledQtScript + || !Qt.script.present ? qbsscriptengine.includePaths : [] + cpp.includePaths: base.concat(bundledQtScriptIncludes).concat([ ".", "../.." // for the plugin headers ]) diff --git a/src/lib/scriptengine/include/QtScript/qtscriptglobal.h b/src/lib/scriptengine/include/QtScript/qtscriptglobal.h new file mode 100644 index 000000000..8b1e09bb1 --- /dev/null +++ b/src/lib/scriptengine/include/QtScript/qtscriptglobal.h @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBS_QTSCRIPTGLOBAL_H +#define QBS_QTSCRIPTGLOBAL_H + +#define Q_SCRIPT_EXPORT +#define Q_SCRIPTTOOLS_EXPORT + +#endif // include guard diff --git a/src/lib/scriptengine/scriptengine.pro b/src/lib/scriptengine/scriptengine.pro index f5d4ad590..c5ad5f07a 100644 --- a/src/lib/scriptengine/scriptengine.pro +++ b/src/lib/scriptengine/scriptengine.pro @@ -61,6 +61,7 @@ DEFINES += JS_NO_EXPORT } INCLUDEPATH += \ + $$PWD/include \ $$OUT_PWD/include \ $$OUT_PWD/include/QtScript/$$[QT_VERSION]/QtScript \ $$PWD/../../shared/qtscript/src/script \ diff --git a/src/lib/scriptengine/scriptengine.qbs b/src/lib/scriptengine/scriptengine.qbs index c92bc1954..77e6ef7d2 100644 --- a/src/lib/scriptengine/scriptengine.qbs +++ b/src/lib/scriptengine/scriptengine.qbs @@ -17,12 +17,18 @@ Project { type: ["staticlibrary"] name: "qbsscriptengine" + generatePkgConfigFile: false + generateQbsModule: false + property bool useSystemMalloc: !qbs.targetOS.contains("macos") && !qbs.targetOS.contains("unix") property string qtscriptPath: "../../shared/qtscript/src/" cpp.includePaths: { - var result = base.concat(["."]); + var result = base.concat( + ".", + "include" + ); var jscBaseDir = qtscriptPath + "3rdparty/javascriptcore"; result.push(jscBaseDir); @@ -355,7 +361,8 @@ Project { Export { Depends { name: "QtScriptFwdHeaders" } Depends { name: "cpp" } - cpp.includePaths: QtScriptFwdHeaders.publicIncludePaths + property stringList includePaths: [product.sourceDirectory + "/include"] + .concat(QtScriptFwdHeaders.publicIncludePaths) Properties { condition: qbs.targetOS.contains("unix") cpp.dynamicLibraries: base.concat(["pthread"]) diff --git a/src/lib/scriptengine/use_scriptengine.pri b/src/lib/scriptengine/use_scriptengine.pri index 296b6e416..6450e171f 100644 --- a/src/lib/scriptengine/use_scriptengine.pri +++ b/src/lib/scriptengine/use_scriptengine.pri @@ -7,4 +7,5 @@ } INCLUDEPATH += \ + $$PWD/include \ $$shadowed($$PWD/include) -- cgit v1.2.3