Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: BDick on August 01, 2018, 11:15:44 pm
-
I have a project with some 300 FORTRAN and ca. 40 C-source files. I use the pgfortran compilers. while most of the FORTRAN files can be compiled with the same options, for a few (ca. 15) loop-unrolling and optimization must be switched off. Also, compilation of the C-files needs different defines on the command line.
My solution is to make the C-files into a different project that produces a library that is then linked within the fortran project. The fortran files with the different options i must compile manually, and then shift the object files into the project before linking.
I wonder whether there is a more elegant way of doing this, e.g. setting different compiler options for different sets of sources. Is this possible?
best regards, Bernhard
-
Yes, Right click on the file -> Properties -> Advanced -> Use custom command to build this file. But you should know the format of the original command in the fortran compiler. Probably you'll have to inspect the advanced settings of the fortran compiler in the compiler options.