Creating new configurations

Added by Ben Hymers over 2 years ago

This is almost certainly a really stupid question. Is there a way to use configurations other than 'debug' and 'release'? They both clearly come with some special setup of their own (defining _DEBUG on Windows, optimisation settings and the like), and I'd like a way to add more configurations and specify those options myself. Apologies if there's already documentation or a sample for this, I couldn't see any from a quick glance.


Replies (3)

RE: Creating new configurations - Added by Joshua Jensen over 2 years ago

Yes, you can use configurations other than 'debug' and 'release' very easily. You can also override existing configurations. This is currently missing from the documentation, and the documentation is the primary reason JamPlus 1.0 has not been formally released yet.

I have published a new sample illustrating it in the jamplus/tests/config_overrides directory.

In a nutshell:

  • Make a c-compilers/ folder next to your top-level Jamfile. If you have the latest JamPlus code (currently in Git, no published snapshot yet), you can more easily put the c-compilers/ folder wherever you would like.
  • In c-compilers/, override files such as win32-vc-debug.jam or make new files like win32-vc-retail.jam.
  • Create a .config file looking somewhat like:
Config =
{
    Configurations = { 'retail', 'debug' },
    JamModulesUserPath = "$(sourceRootPath)/jam",  -- New in latest Git
}
  • Create your workspace via jam --workspace.

Voila! You have new and overridden configurations.

RE: Creating new configurations - Added by Ben Hymers over 2 years ago

Brilliant, you've been marvellous, as ever!

RE: Creating new configurations - Added by Ben Hymers over 2 years ago

One more question; is it possible to override the 'global-[config]' jam files? It doesn't seem to be picking up my new ones. I've created a 'development' configuration, my .config file looks like this:

Config =
{
    Configurations = { 'release', 'debug', 'development' },

    JamModulesUserPath = "$(sourceRootPath)/config" ;
}

And I have two files under config/c-compilers/ called 'global-development.jam' and 'win32-vc-development.jam'. The stuff in 'win32-vc-development.jam' is picked up correctly but it seems to be ignoring 'global-development.jam'. Do I need to do something else to get it to pick it up?

(1-3/3)