Code::Blocks Forums

User forums => Help => Topic started by: linyx on May 22, 2016, 01:52:43 am

Title: compile with different build options(flags)
Post by: linyx on May 22, 2016, 01:52:43 am
Hi, everyone:

Recently I switched from Vim to code::blocks for debugging fortran (I am done with print, print, print,,,,),  but I met a problem in which I cannot solve because of new to CB.

The problem is, say if I have two folders containing the source code in one project to compile. In the first folder I need to add flags like -cpp -O3 or sth, but in the second folder I need to place another flag like -fdefault-real-8, but this is not applicable to the source code in the first folder. How can I define different build options for different  code in one project?

Yuxiang

Title: Re: compile with different build options(flags)
Post by: oBFusCATed on May 22, 2016, 10:39:53 am
4 options:
1. use different project and set the dependencies between them
2. use targets (see the codeblocks-unix.cbp in our source for example)
3. modify the compile command per file (right click on the file -> properties -> advanced -> use custom command)
4. use a makefile and setup a custom makefile project
Title: Re: compile with different build options(flags)
Post by: linyx on May 23, 2016, 01:53:51 am
Thank you for your reply. Actually I used the first option you suggest to solve this problem.

Thank you very much