On 12/15/2017 05:11 PM, Antonio Di Monaco wrote:
Hi,

I'm writing a Qt Creator plugin to support our own custom build process.

My issue is that I cannot find a way to interact with the Clang Code Model plugin, in order to pass to it specific compile options (in my case, it's --gcc-toolchain).

In detail, my plugin automates the kit creation, in order to find out the custom compiler, debugger, and all other stuff we need to build, including our build tool. I'm populating the CppTools::RawProjectsParts data structure according to the specific toolchain that has been selected by the user (that could be a Clang, GCC or MSVC compiler), and everything works fine, as long as I work with the built-in C++ Code Model.

When I activate the Clang Code Model and GCC profile is activated, as the same CppTools::RawProjectsParts data is accessed (is it true or did I miss something?), I encounter a failure, cause if I add the "--gcc-toolchain" parameter, Clang model works, but the built-in fails. And if not, of course the opposite happens, and I'd like to have both running.

I'd like just to interact with the Clang Code Model at "run-time" and, behind the scene, add my mandatory options to it, without asking the user for a UI settings change (also cause the path passed to the "gcc-toolchain" parameter changes according to the profile selected by the user).

My question is: is there an interface, or anything similar, that I can use in order to add such parameters to clang model only? I could also change the Qt Creator code, but I'd like to go for the clean way, if there's any.

Thanks for your help!
A.

Hi!

There is no interface for this right now. All the information for the libclang command line come from the RawProjectsParts and the diagnostic options the user has configured. Currently, no concrete options are forwardable directly with RawProjectsPart because libclang might now understand them, depending on your toolchain....

There is CppModelManager::updateCompilerCallDataForProject(), which basically allows to set a command line, but it's used for the clang static analyzer plugin (not the clang code model) and the qbs project only so far.

I suggest that you modify the Qt Creator code to suit your needs and then push it for review.

Nikolai
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to