Gcc question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Gcc question

Post by REDDemon »

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.
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
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

Re: Gcc question

Post by Katsankat »

not possible
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Gcc question

Post by CuteAlien »

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
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Gcc question

Post by hendu »

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.
Post Reply