It won't work in the foreseeable future, though. The application uses wxWidgets components which depend on other components that require the whole GUI stuff. While it is theoretically possible to build wxWidgets without GUI, it is not possible to build Code::Blocks with such a build.
I remember we tried (maybe 2 years ago) to implement a console-only mode with normal wxWidgets linkage that simply didn't create any windows, hoping it might just work. However, this was not successful. I forgot the actual reason why it didn't work, but the complications were of such nature that we dropped the idea entirely.
I realise the original poster asked for a build without GUI, and I appreciate that it may not be easy to do.
However, there are situations such as this where it would be desirable to run C::B as if it was a console application, even though it is obviously a full-blown GUI application. I just did a small experiment using a wxWidgets dialog based GUI app, to see if I could make it behave like a console application when command line parameters were provided, and I could do it quite easily. I realise the code below is Windows only, but I imagine it wouldn't be impossible to do the same thing on Linux?
#include "DateTimeApp.h"
//(*AppHeaders
#include "DateTimeMain.h"
#include <wx/image.h>
//*)
#include <iostream>
#include <fstream>
using namespace std;
IMPLEMENT_APP(DateTimeApp);
bool DateTimeApp::OnInit()
{
bool wxsOK = true;
if(wxApp::argc > 1) {
// If command line arguments are given, we run as if we are in console mode
// Example is MSW specific
AttachConsole(ATTACH_PARENT_PROCESS); // <== MS WINDOWS API CALL
ifstream conin("con"); //input/output to the console
ofstream conout("con");
cout.rdbuf(conout.rdbuf()); //attach standard stream objects to console
cerr.rdbuf(conout.rdbuf()); //(if you don't use cerr and clog you can of course leave them out)
clog.rdbuf(conout.rdbuf());
cin.rdbuf(conin.rdbuf());
//now you can use regular cout/cin I/O as if in a console
std::cout << "Hello GUI World" << std::endl;
FreeConsole(); // <== MS WINDOWS API CALL
wxsOK = false;
}
else {
//(*AppInitialize
wxInitAllImageHandlers();
if ( wxsOK )
{
DateTimeDialog Dlg(0);
SetTopWindow(&Dlg);
Dlg.ShowModal();
wxsOK = false;
}
}
//*)
return wxsOK;
}
So what you have above, is a small example of a wxWidgets GUI application that behaves as a GUI application when no command line parameters are present, and as a console application when command line parameters are present. Obviously, it could be made to react to a certain command line parameter for console mode use.
So a suggestion might be to consider this technique for the standard C::B GUI build, so that we could build workspaces from the command line without starting the GUI.
Again, I realise this may be slightly different that what the OP asked for, but anyway.