| Summary: | Background parser gets confused by gcc-generated precompiled headers | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | nospam7777123 |
| Component: | Build tools: CMake | Assignee: | kdevelop-bugs-null |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | eugene.shalygin+bugzilla.kde, justusranvier, krzysio.kurek, silverunicorn2011 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | remove CMake-generated precompiled headers from Clang arguments | ||
|
Description
nospam7777123
2019-05-12 08:18:24 UTC
Now with the precompiled headers available in the core CMake, it is even easier to trigger this bug. (In reply to Eugene Shalygin from comment #1) > Now with the precompiled headers available in the core CMake, it is even > easier to trigger this bug. That's exactly what happened to me which is how I found this my way to this issue. I started using target_precompile_headers in my project and suddenly the parser stopped working in kdevelop unless I use clang as the compiler. *** Bug 427002 has been marked as a duplicate of this bug. *** Created attachment 158128 [details]
remove CMake-generated precompiled headers from Clang arguments
While we are waiting for a proper fix, I'd like to share my workaround for GCC and CMake. It simply drops cmake-generated -include path/to/cmake_pch.h[xx] arguments from clang invocation command line.
Even if you use clang as the compiler, the parser may still fail with errors like
> error: GNU extensions was enabled in PCH file but is currently disabled
> error: C11 was enabled in PCH file but is currently disabled
(happens with SDL3 on my system). So removing the include may be necessary on it too. Of course it would be better if KDevelop used the exact same compilation mode the build system uses but that may be tricky and in some cases outright impossible.
|