News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

compile with different build options(flags)

Started by linyx, May 22, 2016, 01:52:43 AM

Previous topic - Next topic

linyx

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


oBFusCATed

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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

linyx

Thank you for your reply. Actually I used the first option you suggest to solve this problem.

Thank you very much