Qt Creator Clang Tools: can't analyze a header file
-
wrote on 31 Dec 2022, 13:05 last edited by
It was reported https://bugreports.qt.io/browse/QTCREATORBUG-28638:
Clang Tools analysis of a C(++) header is impossible with Qt Creator - the error is shown in Issues pane:
:-1: error: Cannot analyze current file: "/home/bam/kde/src/kwin/src/main.h" is not a known source file.
The same file can be analyzed with CLI Clang-Tidy just fine.
Tried on CMake-based KWin project:
https://invent.kde.org/plasma/kwinTo reproduce:
right-click on the header source, from the context menu choose Analyze Current File item -
wrote on 31 Dec 2022, 17:40 last edited by
Qt Creator requires header files to be part of
target_sources
. As you can see at src/CMakeLists.txt · master · Plasma / KWin · GitLab (kde.org) there is nomain.h
there, only the cpp file.See Qt Creator 6 - CMake update for more details.
-
wrote on 6 Jan 2023, 11:20 last edited by
Thank you.
I provided a KWin patch to address this, let's see what colleagues say:
https://invent.kde.org/plasma/kwin/-/merge_requests/3400 -
wrote on 7 Jan 2023, 17:26 last edited by
So as you can see from the MR threads above, I'm not sure if that header addition will be eventually happen - to much work to add all of them.
So it might be solving it on Qt Creator side is still needed, in a common case.. :(
1/4