<table><tr><td style="">kfunk 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/D7876" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I've almost had the same patch locally. So +1 in general.</p>
<p>I'm just wondering if we should rather append the "extraArguments" *after* the project-specific ones. My idea: If e.g. the CMake manager dictates <tt style="background: #ebebeb; font-size: 13px;">-std=c++14</tt>, with my patch this would be part of extraArguments and then the standard version in use by libclang.</p>
<p>With your patch, we would use the <tt style="background: #ebebeb; font-size: 13px;">-std=...</tt> argument used from the parser settings, which might not match what the user wants. IMO we should try to get everything working 'out of the box' as much as possible.</p>
<p>For the record, my patch:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">diff --git a/plugins/custom-definesandincludes/definesandincludesmanager.cpp b/plugins/custom-definesandincludes/definesandincludesmanager.cpp</span>
<span style="color: #000080">index de317ae977..02b5f48f12 100644</span>
<span style="color: #a00000">--- a/plugins/custom-definesandincludes/definesandincludesmanager.cpp</span>
<span style="color: #00a000">+++ b/plugins/custom-definesandincludes/definesandincludesmanager.cpp</span>
<span style="color: #800080">@@ -356,16 +356,18 @@ QString DefinesAndIncludesManager::parserArguments(KDevelop::ProjectBaseItem* it</span>
Q_ASSERT(QThread::currentThread() == qApp->thread());
<span style="color: #00a000">+ auto cfg = item->project()->projectConfiguration().data();</span>
<span style="color: #00a000">+ const auto parserArguments = findConfigForItem(m_settings->readPaths(cfg), item).parserArguments;</span>
<span style="color: #00a000">+ auto arguments = argumentsForPath(item->path(), parserArguments);</span>
<span style="color: #00a000">+</span>
auto buildManager = item->project()->buildSystemManager();
<span style="color: #a00000">- if ( buildManager ) {</span>
<span style="color: #a00000">- const auto args = buildManager->extraArguments(item);</span>
<span style="color: #a00000">- if (!args.isEmpty())</span>
<span style="color: #a00000">- return args;</span>
<span style="color: #00a000">+ if (buildManager) {</span>
<span style="color: #00a000">+ const auto extraArguments = buildManager->extraArguments(item);</span>
<span style="color: #00a000">+ if (!extraArguments.isEmpty())</span>
<span style="color: #00a000">+ arguments += ' ' + extraArguments;</span>
}
<span style="color: #a00000">- auto cfg = item->project()->projectConfiguration().data();</span>
<span style="color: #a00000">- const auto arguments = findConfigForItem(m_settings->readPaths(cfg), item).parserArguments;</span>
<span style="color: #a00000">- return argumentsForPath(item->path(), arguments);</span>
<span style="color: #00a000">+ return arguments;</span>
}
QString DefinesAndIncludesManager::parserArguments(const QString& path) const</pre></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/D7876" rel="noreferrer">https://phabricator.kde.org/D7876</a></div></div><br /><div><strong>To: </strong>gracicot, KDevelop, kfunk<br /><strong>Cc: </strong>kdevelop-devel<br /></div>