Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: terryys on August 18, 2010, 05:51:30 am

Title: Can I define a set of compiler options for every compiler in a project?
Post by: terryys on August 18, 2010, 05:51:30 am
When I switch the compiler from gfortran to g95, the compiler options are carried over (e.g. there is a "-fbacktrace" in g95's other options if I have enabled this in gfortran). Since the extra options are not recognized, the build fails and I have to add/remove the extra options whenever I switch the compiler. Is there a way to change the options automatically when a different compiler is chosen?
Title: Re: Can I define a set of compiler options for every compiler in a project?
Post by: Jenna on August 18, 2010, 07:43:59 am
The easiest way would be to use different targets for different compilers, another possibility is to use scripting (see our wiki (http://wiki.codeblocks.org/index.php?title=Scripting) for details, especially: script expansion (http://wiki.codeblocks.org/index.php?title=Variable_expansion#Script_expansion)).