Skip to content

Commit

Permalink
lupdate: check for clang in environment
Browse files Browse the repository at this point in the history
The configure.pri and configure.json files,
originally located in qttools/src/qdoc,
are moved to qttools/global.
This makes the clang environment accessible
to both qdoc and lupdate.
Both files are adapted to the need of the new lupdate clang-based parser.
(see https://wiki.qt.io/Lupdate_clang-based_c%2B%2B_parser#Clang-environment_and_Qt_configuration for details)

Note:
If the clang environment is not adapted to the upcoming lupdate clang-based parser,
nothing will break, the new parser option will simply not be available.
Nothing is changing for qdoc.

Change-Id: I7297f5894ba7aee669865b0e89aaa298b311e07e
Reviewed-by: Karsten Heimrich <[email protected]>
Reviewed-by: Kai Koehne <[email protected]>
Reviewed-by: Paul Wicking <[email protected]>
  • Loading branch information
lugerard committed Sep 19, 2019
1 parent 1bf4947 commit c7c0815
Show file tree
Hide file tree
Showing 8 changed files with 570 additions and 12 deletions.
2 changes: 1 addition & 1 deletion configure.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"subconfigs": [
"src/qdoc"
"src/global"
]
}
25 changes: 19 additions & 6 deletions src/qdoc/configure.json → src/global/configure.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module": "qdoc",
"module": "tools",
"tests": {
"libclang": {
"label": "libclang",
Expand All @@ -8,7 +8,7 @@
}
},
"features": {
"qdoc": {
"clang": {
"label": "QDoc",
"condition": "tests.libclang",
"output": [
Expand All @@ -19,25 +19,38 @@
{ "type": "varAssign", "name": "CLANG_DEFINES", "value": "tests.libclang.defines" },
{ "type": "varAssign", "name": "CLANG_VERSION", "value": "tests.libclang.version" }
]
},
"clangcpp": {
"label": "Clang-based lupdate parser",
"condition": "features.clang && tests.libclang.has_clangcpp",
"output": [
"privateFeature",
{ "type": "varAssign", "name": "CLANGCPP_LIBS", "value": "tests.libclang.clangcpp_libs" }
]
}
},
"report": [
{
"type": "warning",
"condition": "!features.qdoc",
"message": "QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.

"condition": "!features.clang",
"message": "QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.\n
Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
On macOS, you can use Homebrew's llvm package.
On Windows, you must set LLVM_INSTALL_DIR to the installation path."
},
{
"type": "warning",
"condition": "!features.clangcpp",
"message": "Clang-based lupdate parser will not be available. LLVM and Clang C++ libraries have not been found."
}
],
"summary": [
{
"section": "Qt Tools",
"entries": [
"qdoc"
"clang",
"clangcpp"
]
}
]
Expand Down
Loading

0 comments on commit c7c0815

Please sign in to comment.