<table><tr><td style="">qi437103 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/D5210" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Yeah I still don't understand the overall design well. Here's my understanding, please correct me if I'm wrong</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">The constructor of <tt style="background: #ebebeb; font-size: 13px;">ParserSessionData</tt> is the final place where arguments are assembled. It adds various include and define flags. Before this</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">argsForSession</tt> adds language specific flags in addition to those stored in <tt style="background: #ebebeb; font-size: 13px;">ParserSettings</tt>, which is a <tt style="background: #ebebeb; font-size: 13px;">QString</tt>.</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">ParserSettings</tt> comes from <tt style="background: #ebebeb; font-size: 13px;">ClangParsingEnvironment</tt>, which is set in the constructor of <tt style="background: #ebebeb; font-size: 13px;">ClangParserJob</tt>. The value is from <tt style="background: #ebebeb; font-size: 13px;">ClangSettingsManager::parserSettings</tt>, which</li>
<li class="remarkup-list-item">Delegates the call to <tt style="background: #ebebeb; font-size: 13px;">DefinesAndIncludesManager::parserArguments</tt>.</li>
<li class="remarkup-list-item">In <tt style="background: #ebebeb; font-size: 13px;">DefinesAndIncludesManager::parserArguments</tt>, the arguments are computed by <tt style="background: #ebebeb; font-size: 13px;">argumentsForPath</tt>, which basically returns corresponding string in <tt style="background: #ebebeb; font-size: 13px;">ParserArguments</tt></li>
<li class="remarkup-list-item">And <tt style="background: #ebebeb; font-size: 13px;">ParserArguments</tt> comes from the configuration file, which can be set by user using config dialog</li>
</ul>

<p>I can add nvcc (CUDA) to the compiler provider as a <tt style="background: #ebebeb; font-size: 13px;">GcLickCompiler</tt>, and do path detection there. But I'm not clear about how that information can be used in the above process. In <tt style="background: #ebebeb; font-size: 13px;">DefinesAndIncludesManager::parserArguments</tt>, should I use <tt style="background: #ebebeb; font-size: 13px;">findConfigForItem(...).compiler->path()</tt> to get the path to nvcc and add proper <tt style="background: #ebebeb; font-size: 13px;">--cuda-path</tt> there?</p>

<p>However the compiler is set for the whole project (at the right bottom corner of the config dialog if I understand correctly), while what we want here is actually per file type compiler.</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/D5210" rel="noreferrer">https://phabricator.kde.org/D5210</a></div></div><br /><div><strong>To: </strong>qi437103, kfunk, KDevelop, mwolff<br /><strong>Cc: </strong>kdevelop-devel<br /></div>