are there pre-compiler options in GCC for setting up specific compiler flags? (for example if I want to set -O1 for a specific function, is there a stack of attributes for doing that on a per line basis?). The problem is that a specific function with many loops halves its execution time only with a specific compiler flag. Setting that flag for the whole project is not a choice because if I setup that flag for the whole project the game slow drammatically down (10%). I tried to google around without luck
Please don't tell me to don't do that. Tell me just only if it is possilbe and how.
Gcc question
Gcc question
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: Gcc question
not possible
Re: Gcc question
Not per line, but I per .cpp should be possible - so you could put certain functions in their own .cpp file. You probably have to separate the compiling and linking step so you can use different compile options for different object files (or put them in a lib which is pretty much the same).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Gcc question
Yes, IIRC you can set optimization flags per-function. Though I think they were the specific ones, and not the bigger levels O1 O2 etc.