News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How can i get CompilerID from compiler name?

Started by Jungle, August 31, 2012, 12:54:17 PM

Previous topic - Next topic

Jungle

I've recently spent much time trying to find out why SetCompilerID() doesn't work. I thought that CompilerID == compiler name, but i was wrong. So the question is: how can i get Compiler ID from compiler name?

Alpha


wxString name = wxT("My Example Compiler");
Compiler* comp = CompilerFactory::GetCompilerByName(name);
comp->GetID();

Jungle

That is what i get when calling from Wizard script:
QuoteSquirrelFunction<> call failed
AN ERROR HAS OCCURED [the index 'GetCompilerByName' does not exist]

And there is no GetCompilerByName function on the "Scripting commands" wiki page.

Alpha

Sorry, I did not realize you were scripting.

What is it you are trying to achieve?  Is it that you have a compiler's name (from somewhere), and are trying to set a build target/project to use that compiler?

Jungle

Yes, i've created 2 new compiler profiles which i use from project wizard script (without compiler selection page). Of course i've already got compiler id's. But i'm not sure that they will always stay the same.

Alpha

From what I can tell, you are correct; the required functions are not bound.  If you wanted, you could edit sdk/scripting/bindings/scriptbindings.cpp to add the functionality.

Probably in your situation it would be good enough to simply script in the expected values (the alternative requires editing Code::Blocks).

(A note about how Code::Blocks uses compilers: the user is allowed to rename them, however, their ID's are always supposed to remain the same.)