Reputation: 5188
Is there an option to force the generated makefile read the CXXFLAGS
and CFLAGS
variables and use them as most of makefiles do?
Upvotes: 3
Views: 2486
Reputation: 9
I solved this problem by not selecting the "Use default build command" radio box in the C/C++ Build Setting.
Specify custom Build command: make -f Makefile. You can add additional compiler options in the $CCFLAGS defined in the targeted Makefile.
Upvotes: 0
Reputation: 3395
Eclipse CDT generated makefiles have the following lines included:
-include ../makefile.init
-include ../makefile.defs
You can create the file makefile.defs in which you define CFLAGS or CXXFLAGS and then go to project Properties
-> C++ Build Properties
-> Settings
-> GCC or G++ compiler -> Miscellaneous
. Here you can add your $(CFLAGS) or $(CXXFLAGS) option in the Other flags
field.
This should add your additional options to the compiler command line.
Upvotes: 4