<table><tr><td style="">rjvbb created this revision.<br />rjvbb added a reviewer: KDevelop.<br />rjvbb added a project: KDevelop.<br />rjvbb requested review of this revision.
</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/D17858">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This is an extension to <a href="https://phabricator.kde.org/D15955" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: line-through;">D15955</a>, introducing dynamic determination of the clang builtin directory on Unix.</p>

<p>The builtin directory on typical Unix installs takes the for of <tt style="background: #ebebeb; font-size: 13px;">/path/to/llvm-$clangMajor.0/lib/clang/$clangMajor.0.$clangMinor/include</tt> (e.g. <tt style="background: #ebebeb; font-size: 13px;">/usr/lib/llvm-6.0/lib/clang/6.0.1/include</tt> for the offical LLVM packages for Debian/Ubuntu, or <tt style="background: #ebebeb; font-size: 13px;">/opt/local/libexec/llvm-6.0/lib/clang/6.0.1/include</tt> for the MacPorts clang versions on Mac).</p>

<p>Minor version upgrades only change the penultimate path component. This patch updates the version in the hardcoded path to the version of the libclang actually used by dropping the last 2 components of the path and then adding the correct components.</p>

<p>This modification removes the need to rebuild all KDevelop packages to account for a single string change when a libclang update is pushed.</p>

<p>BUG: 402628</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Works as expected: recreates the identical version if libclang hasn't been upgraded. A rebuilt kdev-clang plugin with a tweaked <tt style="background: #ebebeb; font-size: 13px;">KDEV_CLANG_BUILTIN_DIR</tt> macro in $build.dir/plugins/clang/libclang_include_path.h (e.g. <tt style="background: #ebebeb; font-size: 13px;">6.0.0</tt> instead of <tt style="background: #ebebeb; font-size: 13px;">6.0.1</tt>) still finds the correct header directory.</p></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/D17858">https://phabricator.kde.org/D17858</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/clang/duchain/clanghelpers.cpp</div></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>