<table><tr><td style="">mwolff added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12331">View Revision</a></tr></table><br /><div><div><p>To query what include files you got, the easiest really is to define the <tt style="background: #ebebeb; font-size: 13px;">KDEV_CLANG_DISPLAY_ARGS=1</tt> env var. Then you'll see the command line we use for libclang, which includes the include paths. Defines could be queried by setting <tt style="background: #ebebeb; font-size: 13px;">KDEV_CLANG_DISPLAY_DEFINES=1</tt>.</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12331#inline-62705">View Inline</a><span style="color: #4b4d51; font-weight: bold;">apol</span> wrote in <span style="color: #4b4d51; font-weight: bold;">libclang_include_path.h.cmake:22</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Okay, doesn't make a lot of sense from my ignorant perspective. :P</p>

<p style="padding: 0; margin: 8px;">It sounds to me like we should be telling about the system we are targetting. In fact, I'm surprised that sysroot isn't necessary.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I think your understanding of how it should be is the exact opposite of what's actually required :D</p>

<p style="padding: 0; margin: 8px;">While parsing with libclang, we have to use the builtin headers from clang that exactly match the version of libclang we are using. With builtin headers, I mean e.g. /usr/lib/clang/6.0.0/include/xmmintrin.h - this is what we have to use when we parse with libclang 6.0.0. And this is independent of what compiler we actually use for the project we parse, this really is just related to the libclang version we use for parsing.</p>

<p style="padding: 0; margin: 8px;">The reason is that these headers use builtins that are highly compiler and version specific. Trying to use GCCs builtins, or even those from a newer clang will fail in horrible ways (cf. all the bug reports we got).</p>

<p style="padding: 0; margin: 8px;">This also explains why we don't need to specify the sysroot.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12331">https://phabricator.kde.org/D12331</a></div></div><br /><div><strong>To: </strong>mwolff<br /><strong>Cc: </strong>apol, mschwarz, brauch, kdevelop-devel<br /></div>