https://bugs.kde.org/show_bug.cgi?id=506320
Bug ID: 506320
Summary: KDEClangFormat results in cmake errors if .ccls-cache
is present
Classification: Frameworks and Libraries
Product: extra-cmake-modules
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
***
If you're not sure this is actually a bug, instead post about it at
https://discuss.kde.org
If you're reporting a crash, attach a backtrace with debug symbols; see
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Please remove this comment after reading and before submitting - thanks!
***
SUMMARY
I use ccls as language server, and it will make KDEClangFormat unhappy when I
run cmake.
STEPS TO REPRODUCE
0. Have clang-format executable
1. Have ccls run as your language server in the kwin repo
2. cmake in the kwin repo
3.
OBSERVED RESULT
CMake Error at /home/user/kde/usr/share/ECM/kde-modules/KDEClangFormat.cmake:97
(add_custom_target):
The target name
"clang-format-.ccls-cache_@@home@user@kde@src@kwin_@usr@include@[email protected]"
is reserved or not valid for certain CMake features, such as generator
expressions, and may result in undefined behavior.
Call Stack (most recent call first):
CMakeLists.txt:517 (kde_clang_format)
CMake Error at
/home/user/kde/usr/share/ECM/kde-modules/KDEClangFormat.cmake:100
(add_custom_command):
No TARGET
'clang-format-.ccls-cache_@@home@user@kde@src@kwin_@usr@include@[email protected]'
has been created in this directory.
Call Stack (most recent call first):
CMakeLists.txt:517 (kde_clang_format)
(and more errors like this)
EXPECTED RESULT
No errors should occur.
SOFTWARE/OS VERSIONS
Windows:
macOS:
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: irrelevant
KDE Plasma Version: irrelevant
KDE Frameworks Version: master (from kdesrc-build)
Qt Version: irrelevant
ADDITIONAL INFORMATION
The KDEClangFormat.cmake says the following:
```
To exclude directories from the formatting add a ``.clang-format``
file in the directory with the following contents:
.. code-block:: yaml
DisableFormat: true
SortIncludes: false
```
But after I added .clang-format file with the specified content inside
.ccls-cache and it still show up the errors in cmake.
contents in the .ccls-cache directory:
```
] find ~/kde/src/kwin/.ccls-cache
/home/user/kde/src/kwin/.ccls-cache
/home/user/kde/src/kwin/.ccls-cache/.clang-format
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@src@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@src@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@src@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@src@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@src@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@home@user@kde@src@kwin/src@plugins@kdecorations@aurorae@src@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin/@usr@include@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin/@usr@include@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin/@usr@include@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin/@usr@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin/@usr@include@[email protected]
/home/user/kde/src/kwin/.ccls-cache/@@home@user@kde@src@kwin/@usr@[email protected]
```
--
You are receiving this mail because:
You are watching all bug changes.