Thank you for replying, much appreciated. I'm not too familiar with Squirrel, that's true, but my knowledge is not a showstopper as far as the test script goes.
Here's the script. I've stripped it down so it tries to add an 'include' search path directly instead of using 'cmd.exe'. Better for the purpose of illustration:
// not called: clearly needs to be executed as build script
function SetBuildOptions(baseOptions)
{
Log(_T("***** [xod] SetBuildOptions() *****"));
}
// called
function OnMenuClick()
{
// nothing happens
CompileOptionsBase().AddIncludeDir(_T("E:\\applications\\__inpath__\\allegro\\include"));
CompileOptionsBase.AddIncludeDir(_T("E:\\applications\\__inpath__\\allegro\\include"));
}
Log(_T("***** xod - begin *****"));
local scriptManager = GetScriptingManager();
scriptManager.RegisterScriptMenu(_T("Settings/[xod] Add __inpath__ SDK paths"), _T("OnMenuClick"), true); // ok
local compilerFactory = GetCompilerFactory();
Log(_T("Number of compilers: " + compilerFactory.GetCompilersCount())); // index 'GetCompilersCount' not found
local gcc = compilerFactory.GetCompilerByName(_T("GNU GCC Compiler")); // same here, would this line execute
Log(_T("***** xod - end *****"));
I had hoped that a startup script could register (or merely define) callbacks for events relating to the various stages of C::B's build progress, and provide contextual interfaces obviously. I much prefer my scripts to not be attached per project manually and instead be global and start on C::B's startup. Is that possible ?
*EDIT*
Like you wrote, I should have used GetCompilerIDByName(). Problem is though that the apparent CompilerFactory API exposed to scripts merely returns wsStrings, bools, and ints. No objects. I suppose I looked in the C++ 'SDK documentation' and presumed the (full) C++ CompilerFactory API be exposed to scripts too.
*EDIT 2*
I have made a script plugin as well, but no new API under the sun there as far as I can tell; I didn't find any doc on cbScriptPlugin..