qbs build: Prefer KSyntaxHighlighting from system

Note that the system package will only be found with qbs >= 1.20.

Change-Id: I361b774d6b35fdbd0386144d4e9812f02f7841e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-05-11 11:38:27 +02:00
parent 1ea3d707c6
commit da8b3f237a
2 changed files with 26 additions and 1 deletions

View File

@@ -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

View File

@@ -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"