Correctly include KSyntaxHighlighting headers

In external KSyntaxHighlighting, these headers now have paths like
/usr/include/KF5/KSyntaxHighlighting/KSyntaxHighlighting/AbstractHighlighter,
where /usr/include/KF5/KSyntaxHighlighting is passed to compiler as include
path.

Old headers which had only one KSyntaxHighlighting fragment in path were
removed in v5.94.0:
https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/305

Adjust our vendored version to make the code work with both external and
vendored versions.

Change-Id: Iadcc668c3c705c563ae359301d227ee19eadca0f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Dmitry Shachnev
2022-05-18 18:03:22 +03:00
parent ef2ddeb00b
commit 4d9215e44d
16 changed files with 98 additions and 92 deletions

View File

@@ -9,6 +9,7 @@ add_qtc_library(KSyntaxHighlighting
INCLUDES autogenerated/
PUBLIC_INCLUDES
src/lib
autogenerated/include
autogenerated/src/lib
DEPENDS Qt5::Network Qt5::Widgets
SOURCES
@@ -49,7 +50,7 @@ if (QTC_STATIC_BUILD)
endif()
extend_qtc_library(KSyntaxHighlighting ${export_symbol_declaration})
qtc_add_public_header(autogenerated/src/lib/State)
qtc_add_public_header(autogenerated/include/KSyntaxHighlighting/State)
if(TARGET KSyntaxHighlighting)
install(

View File

@@ -4,34 +4,34 @@ Date: Tue, 12 Feb 2019 19:45:08 +0100
Subject: [PATCH 3/6] Add qmake/Qbs files and files generated by CMake
---
autogenerated/autogenerated.pri | 9 ++
autogenerated/autogenerated.pri | 10 +++
.../KSyntaxHighlighting/AbstractHighlighter | 1 +
.../include/KSyntaxHighlighting/Definition | 1 +
.../include/KSyntaxHighlighting/FoldingRegion | 1 +
.../include/KSyntaxHighlighting/Format | 1 +
.../include/KSyntaxHighlighting/Repository | 1 +
.../include/KSyntaxHighlighting/State | 1 +
.../KSyntaxHighlighting/SyntaxHighlighter | 1 +
.../include/KSyntaxHighlighting/Theme | 1 +
autogenerated/ksyntaxhighlighting_version.h | 12 +++
autogenerated/src/lib/AbstractHighlighter | 1 +
autogenerated/src/lib/Definition | 1 +
autogenerated/src/lib/FoldingRegion | 1 +
autogenerated/src/lib/Format | 1 +
autogenerated/src/lib/Repository | 1 +
autogenerated/src/lib/State | 1 +
autogenerated/src/lib/SyntaxHighlighter | 1 +
autogenerated/src/lib/Theme | 1 +
.../src/lib/ksyntaxhighlighting_logging.cpp | 11 +++
.../src/lib/ksyntaxhighlighting_logging.h | 11 +++
data/data.pro | 11 +++
src/lib/ksyntaxhighlighting_export.h | 34 +++++++
syntax-highlighting.pro | 55 ++++++++++++
syntax-highlighting.qbs | 88 +++++++++++++++++++
syntax-highlighting.qbs | 90 +++++++++++++++++++
syntax-highlighting_dependencies.pri | 3 +
17 files changed, 242 insertions(+)
17 files changed, 245 insertions(+)
create mode 100644 autogenerated/autogenerated.pri
create mode 100644 autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
create mode 100644 autogenerated/include/KSyntaxHighlighting/Definition
create mode 100644 autogenerated/include/KSyntaxHighlighting/FoldingRegion
create mode 100644 autogenerated/include/KSyntaxHighlighting/Format
create mode 100644 autogenerated/include/KSyntaxHighlighting/Repository
create mode 100644 autogenerated/include/KSyntaxHighlighting/State
create mode 100644 autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
create mode 100644 autogenerated/include/KSyntaxHighlighting/Theme
create mode 100644 autogenerated/ksyntaxhighlighting_version.h
create mode 100644 autogenerated/src/lib/AbstractHighlighter
create mode 100644 autogenerated/src/lib/Definition
create mode 100644 autogenerated/src/lib/FoldingRegion
create mode 100644 autogenerated/src/lib/Format
create mode 100644 autogenerated/src/lib/Repository
create mode 100644 autogenerated/src/lib/State
create mode 100644 autogenerated/src/lib/SyntaxHighlighter
create mode 100644 autogenerated/src/lib/Theme
create mode 100644 autogenerated/src/lib/ksyntaxhighlighting_logging.cpp
create mode 100644 autogenerated/src/lib/ksyntaxhighlighting_logging.h
create mode 100644 data/data.pro
@@ -42,10 +42,11 @@ Subject: [PATCH 3/6] Add qmake/Qbs files and files generated by CMake
diff --git a/autogenerated/autogenerated.pri b/autogenerated/autogenerated.pri
new file mode 100644
index 0000000..aee620a
index 0000000..4121aaf
--- /dev/null
+++ b/autogenerated/autogenerated.pri
@@ -0,0 +1,9 @@
@@ -0,0 +1,10 @@
+INCLUDEPATH *= $$PWD/include
+INCLUDEPATH *= $$PWD/src/lib
+INCLUDEPATH *= $$PWD
+
@@ -55,9 +56,65 @@ index 0000000..aee620a
+HEADERS += \
+ $$PWD/ksyntaxhighlighting_version.h \
+ $$PWD/src/lib/ksyntaxhighlighting_logging.h
diff --git a/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter b/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
new file mode 100644
index 0000000..b787873
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/AbstractHighlighter
@@ -0,0 +1 @@
+#include "abstracthighlighter.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/Definition b/autogenerated/include/KSyntaxHighlighting/Definition
new file mode 100644
index 0000000..2c3241f
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/Definition
@@ -0,0 +1 @@
+#include "definition.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/FoldingRegion b/autogenerated/include/KSyntaxHighlighting/FoldingRegion
new file mode 100644
index 0000000..005b829
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/FoldingRegion
@@ -0,0 +1 @@
+#include "foldingregion.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/Format b/autogenerated/include/KSyntaxHighlighting/Format
new file mode 100644
index 0000000..b0d6a10
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/Format
@@ -0,0 +1 @@
+#include "format.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/Repository b/autogenerated/include/KSyntaxHighlighting/Repository
new file mode 100644
index 0000000..189dbc2
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/Repository
@@ -0,0 +1 @@
+#include "repository.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/State b/autogenerated/include/KSyntaxHighlighting/State
new file mode 100644
index 0000000..e148d70
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/State
@@ -0,0 +1 @@
+#include "state.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter b/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
new file mode 100644
index 0000000..b429824
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/SyntaxHighlighter
@@ -0,0 +1 @@
+#include "syntaxhighlighter.h"
diff --git a/autogenerated/include/KSyntaxHighlighting/Theme b/autogenerated/include/KSyntaxHighlighting/Theme
new file mode 100644
index 0000000..34a3e98
--- /dev/null
+++ b/autogenerated/include/KSyntaxHighlighting/Theme
@@ -0,0 +1 @@
+#include "theme.h"
diff --git a/autogenerated/ksyntaxhighlighting_version.h b/autogenerated/ksyntaxhighlighting_version.h
new file mode 100644
index 0000000..bd31a4d
index 0000000..4336b19
--- /dev/null
+++ b/autogenerated/ksyntaxhighlighting_version.h
@@ -0,0 +1,12 @@
@@ -66,69 +123,13 @@ index 0000000..bd31a4d
+#ifndef SyntaxHighlighting_VERSION_H
+#define SyntaxHighlighting_VERSION_H
+
+#define SyntaxHighlighting_VERSION_STRING "5.52.0"
+#define SyntaxHighlighting_VERSION_STRING "5.90.0"
+#define SyntaxHighlighting_VERSION_MAJOR 5
+#define SyntaxHighlighting_VERSION_MINOR 52
+#define SyntaxHighlighting_VERSION_MINOR 90
+#define SyntaxHighlighting_VERSION_PATCH 0
+#define SyntaxHighlighting_VERSION ((5<<16)|(52<<8)|(0))
+#define SyntaxHighlighting_VERSION ((5<<16)|(90<<8)|(0))
+
+#endif
diff --git a/autogenerated/src/lib/AbstractHighlighter b/autogenerated/src/lib/AbstractHighlighter
new file mode 100644
index 0000000..b787873
--- /dev/null
+++ b/autogenerated/src/lib/AbstractHighlighter
@@ -0,0 +1 @@
+#include "abstracthighlighter.h"
diff --git a/autogenerated/src/lib/Definition b/autogenerated/src/lib/Definition
new file mode 100644
index 0000000..2c3241f
--- /dev/null
+++ b/autogenerated/src/lib/Definition
@@ -0,0 +1 @@
+#include "definition.h"
diff --git a/autogenerated/src/lib/FoldingRegion b/autogenerated/src/lib/FoldingRegion
new file mode 100644
index 0000000..005b829
--- /dev/null
+++ b/autogenerated/src/lib/FoldingRegion
@@ -0,0 +1 @@
+#include "foldingregion.h"
diff --git a/autogenerated/src/lib/Format b/autogenerated/src/lib/Format
new file mode 100644
index 0000000..b0d6a10
--- /dev/null
+++ b/autogenerated/src/lib/Format
@@ -0,0 +1 @@
+#include "format.h"
diff --git a/autogenerated/src/lib/Repository b/autogenerated/src/lib/Repository
new file mode 100644
index 0000000..189dbc2
--- /dev/null
+++ b/autogenerated/src/lib/Repository
@@ -0,0 +1 @@
+#include "repository.h"
diff --git a/autogenerated/src/lib/State b/autogenerated/src/lib/State
new file mode 100644
index 0000000..e148d70
--- /dev/null
+++ b/autogenerated/src/lib/State
@@ -0,0 +1 @@
+#include "state.h"
diff --git a/autogenerated/src/lib/SyntaxHighlighter b/autogenerated/src/lib/SyntaxHighlighter
new file mode 100644
index 0000000..b429824
--- /dev/null
+++ b/autogenerated/src/lib/SyntaxHighlighter
@@ -0,0 +1 @@
+#include "syntaxhighlighter.h"
diff --git a/autogenerated/src/lib/Theme b/autogenerated/src/lib/Theme
new file mode 100644
index 0000000..34a3e98
--- /dev/null
+++ b/autogenerated/src/lib/Theme
@@ -0,0 +1 @@
+#include "theme.h"
diff --git a/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp b/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp
new file mode 100644
index 0000000..4082ac4
@@ -283,10 +284,10 @@ index 0000000..38127e1
+ src/lib/wildcardmatcher.cpp \
diff --git a/syntax-highlighting.qbs b/syntax-highlighting.qbs
new file mode 100644
index 0000000..248ebe0
index 0000000..4f6de09
--- /dev/null
+++ b/syntax-highlighting.qbs
@@ -0,0 +1,88 @@
@@ -0,0 +1,90 @@
+import qbs 1.0
+import qbs.File
+import qbs.FileInfo
@@ -324,6 +325,7 @@ index 0000000..248ebe0
+ cpp.defines: base.concat("KSYNTAXHIGHLIGHTING_LIBRARY")
+ cpp.includePaths: [
+ product.sourceDirectory + "/src/lib/",
+ product.sourceDirectory + "/autogenerated/include/",
+ product.sourceDirectory + "/autogenerated/src/lib/",
+ product.sourceDirectory + "/autogenerated/"
+ ]
@@ -370,6 +372,7 @@ index 0000000..248ebe0
+ Depends { name: "cpp" }
+ cpp.includePaths: [
+ product.sourceDirectory + "/src/lib/",
+ product.sourceDirectory + "/autogenerated/include/",
+ product.sourceDirectory + "/autogenerated/src/lib/",
+ ]
+ }

View File

@@ -28,6 +28,7 @@ Project {
cpp.defines: base.concat("KF5SyntaxHighlighting_EXPORTS")
cpp.includePaths: [
product.sourceDirectory + "/src/lib/",
product.sourceDirectory + "/autogenerated/include/",
product.sourceDirectory + "/autogenerated/src/lib/",
product.sourceDirectory + "/autogenerated/"
]
@@ -122,6 +123,7 @@ Project {
Depends { name: "cpp" }
cpp.includePaths: [
exportingProduct.sourceDirectory + "/src/lib/",
exportingProduct.sourceDirectory + "/autogenerated/include/",
exportingProduct.sourceDirectory + "/autogenerated/src/lib/",
]
}

View File

@@ -38,11 +38,11 @@
#include <utils/qtcassert.h>
#include <utils/stylehelper.h>
#include <DefinitionDownloader>
#include <FoldingRegion>
#include <Format>
#include <Repository>
#include <SyntaxHighlighter>
#include <KSyntaxHighlighting/DefinitionDownloader>
#include <KSyntaxHighlighting/FoldingRegion>
#include <KSyntaxHighlighting/Format>
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/SyntaxHighlighter>
#include <QLoggingCategory>
#include <QMetaEnum>

View File

@@ -29,8 +29,8 @@
#include <utils/fileutils.h>
#include <AbstractHighlighter>
#include <Definition>
#include <KSyntaxHighlighting/AbstractHighlighter>
#include <KSyntaxHighlighting/Definition>
namespace TextEditor {
class TextDocument;

View File

@@ -32,7 +32,7 @@
#include <utils/id.h>
#include <State>
#include <KSyntaxHighlighting/State>
#include <QTextBlockUserData>
#include <QPlainTextDocumentLayout>