Pull request for new ld behavior

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3

Pull request for new ld behavior

Post by Svenstaro »

So ld stopped implicitly appending all kinds of libs to its targets and accordingly Ogre needs to make this link explicit. I made a pull request for that: https://bitbucket.org/sinbad/ogre/pull- ... ost-system

Please merge. Users on other platforms will get no ill effects from this as anybody using boost thread will also have boost system.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Pull request for new ld behavior

Post by CABAListic »

Hm, is this only a dependency problem with Boost 1.50? Because with Boost up to 1.49 I've never seen this problem on any platform so far. And I don't think that Boost system was implicitly linked on all of them.

Boost Thread documentation also only references Boost System since 1.50, so that would encourage my assumption that this dependency is new. Given that 1.50 is still relatively new we might want to consider a conditional on adding the dependency?
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3

Re: Pull request for new ld behavior

Post by Svenstaro »

Oh, I didn't consider it a boost 1.50 thing but it might just be it! I don't really see the need for the conditionals though since everybody will have boost.system anyway. I can change my patch though if this is a requirements for merging.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Pull request for new ld behavior

Post by CABAListic »

If it wasn't a dependency before it's theoretically possible someone doesn't have boost.system around. More so, if linking dynamically you would potentially create an unnecessary coupling to an unneeded library. So I think it might be cleaner to only add the link if it's really necessary. It does make the Boost detection process a little uglier, since you'll probably have to call it twice to be able to implement a conditional on the Boost version.
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3

Re: Pull request for new ld behavior

Post by Svenstaro »

I updated the patch to fit your description. It now only adds system if you use boost >= 1.50 in a clean manner.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Pull request for new ld behavior

Post by CABAListic »

Thanks. :) I can probably apply it on the weekend, if no one beats me to it.

Edit: Actually I don't think it will work like that. For Boost_VERSION to be set you probably have to call find_package(Boost ...) first. My hope would be that calling it for thread and date-time and then again with system if required should work.
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3

Re: Pull request for new ld behavior

Post by Svenstaro »

Aw crap. It only worked because I didn't clean my build dir. Next patch works without any pre-cached variables.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: Pull request for new ld behavior

Post by CABAListic »

Thanks, that looks about right.
User avatar
Svenstaro
Greenskin
Posts: 115
Joined: Fri Dec 15, 2006 1:30 pm
Location: Germany
x 3

Re: Pull request for new ld behavior

Post by Svenstaro »

It doesn't need Chrono under Linux apparently.