ccodeblocks

Compiling Options in Code Blocks


I want to to be able to enter the options in Code Blocks. Like I want to do gcc -P test.c. How should I go about doing this? Basically, I want Code Blocks to give a prompt box each time I compile so that I can enter the options in that box. Is that functionality available in Code Blocks?


Solution

  • The behaviour that you want in your updated answer is not available in Code::Blocks.

    However, you should be able to get this behaviour if you invest the time to write a plugin for that (should be under an hour, depening on your wxWidgets skill, the GUI bit to pop up the dialog will probably be the hardest thing).

    Either write a script plugin (this is allegedly the easiest and quickest way, though I've never done that, so cannot tell for sure) -- look at share/codeblocks/scripts/sample_plugin.script, and see if you can adapt that -- or write a proper plugin in C++.
    Edit: some sparse docs on script plugin.

    Look for example at src/plugins/autosave/autosave.[h|cpp] (which is one of the most primitive plugins) to learn how this is done. Something like this should work:

    Alternatively, one could probably just call cbProject::ShowOptions() (after all, the event gives you a pointer to a cbProject, so why not just use that) when cbEVT_COMPILER_STARTED is received, that should bring up the builtin options dialog.