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.

Gcc question

Postby REDDemon » Tue Dec 27, 2011 6:07 am

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.
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.
User avatar
REDDemon
 
Posts: 831
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Gcc question

Postby Katsankat » Tue Dec 27, 2011 6:21 am

not possible
Katsankat
 
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am

Re: Gcc question

Postby CuteAlien » Tue Dec 27, 2011 9:44 am

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.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5358
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Gcc question

Postby hendu » Thu Dec 29, 2011 4:17 pm

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


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest