diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index a16957c0ee3..8a242902426 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -68,6 +68,8 @@ Module { property bool enableUbSanitizer: false property bool enableThreadSanitizer: false + property bool preferSystemSyntaxHighlighting: true + property bool make_dev_package: false // Will be replaced when creating modules from products diff --git a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs index 2261d97d697..e3c7682e3f5 100644 --- a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs +++ b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs @@ -4,9 +4,27 @@ import qbs.FileInfo import qbs.Environment Project { - QtcLibrary { + Product { name: "KSyntaxHighlighting" + Export { + Depends { name: "qtc" } + Depends { + name: "Qt.KSyntaxHighlighting" + condition: qtc.preferSystemSyntaxHighlighting + required: false + } + Depends { + name: "KSyntaxHighlighting_bundled" + required: !qtc.preferSystemSyntaxHighlighting + } + } + } + + QtcLibrary { + name: "KSyntaxHighlighting_bundled" + condition: !qtc.preferSystemSyntaxHighlighting || !Qt.KSyntaxHighlighting.present + cpp.defines: base.concat("KSYNTAXHIGHLIGHTING_LIBRARY") cpp.includePaths: [ product.sourceDirectory + "/src/lib/", @@ -16,6 +34,11 @@ Project { Depends { name: "Qt.gui" } Depends { name: "Qt.network" } + Depends { + name: "Qt.KSyntaxHighlighting" + condition: qtc.preferSystemSyntaxHighlighting + required: false + } Group { name: "lib"