Code archives/Miscellaneous/Make the compiler build settings local to your project

This code has been declared by its author to be Public Domain code.

Download source code

Make the compiler build settings local to your project by Zethrax2014
This code is for BlizMax.

One pet peeve I have with many compilers is that they have the build options set in the IDE rather than having them local to the actual project being compiled. This is a massive nuisance requiring you to change the build settings for each individual project each time you swap between projects. This is particularly annoying when working on a client-server project where you may need a GUI build for the client project and a console build for the server, and need to work on both at once as you tweak them.

The two methods below modify the 'bmk.exe' file that controls the build options for the BlitzMax compiler in order to override the build options set in the IDE and make the build options local to the project being built. Pick whichever method suits you best. You can also use both methods at once.

-

Before making any changes first back up your 'C:\BlitzMax\src\bmk\bmk.bmx' and 'C:\BlitzMax\bin\bmk.exe' files in case you need to restore them to their original state.

-

Whichever one of the config option methods you choose to use below should go after the line:-

args=ParseConfigArgs( AppArgs[2..] )

and before the line:-

CreateDir BlitzMaxPath()+"/tmp"

in the 'bmk.bmx' file found in the 'C:\BlitzMax\src\bmk' folder (the exact folderpath may be different on different systems).

Compile the 'bmk.bmx' file as a unthreaded console release build and place the resulting 'bmk.exe' file in the 'C:\BlitzMax\bin' folder (the exact folderpath may be different on different systems).

-

If you want to test the resulting build settings then place this code below the added code:-

Print "opt_apptype = " + opt_apptype
Print "opt_threaded = " + opt_threaded
Print "opt_debug = " + opt_debug
Print "opt_release = " + opt_release
Print "opt_outfile = " + opt_outfile
Delay( 10000 )


=============================================================


Method 1 - Config options stored in the first line of a project's main source code file.



==========


Method 2 - Config options are stored inside square brackets in the filename of a project's main source code file.
Note that the 'OUTPUTFILE' option is not supported for this method.
You can find the code at: http://www.blitzbasic.com/codearcs/codearcs.php?code=3137

Comments

None.

Code Archives Forum