Page 1 of 1

Hide threading header

Posted: Fri Jun 14, 2013 5:02 pm
by Transporter
It would be nice to hide the headers of threading dependencies. Have a look what happend after including Ogre.h:

Ogre.h -> OgrePrerequisites.h -> OgrePlatform.h -> OgreConfig.h -> OgreBuildSettings.h

Code: Select all

#define OGRE_THREAD_SUPPORT 2

#define OGRE_THREAD_PROVIDER 1
Ogre.h -> OgrePrerequisites.h -> Threading/OgreThreadDefines.h -> Threading/OgreThreadDefinesBoost.h
Ogre.h -> OgrePrerequisites.h -> OgreStdHeaders.h -> Threading/OgreThreadHeaders.h -> Threading/OgreThreadHeadersBoost.h -> BOOST

That means you have to add boost to all Ogre projects. Evan if you use Ogre as shared libraries, you also have to add boost. It would be helpful to include the threading libraries only in cpp code or headers which only used for building Ogre to avoid including any external library using the SDK. Using windows is also adding more issues because of boost auto linking, which is enabled by default.

Re: Hide threading header

Posted: Fri Jun 14, 2013 5:43 pm
by spacegaier
Can you please create a JIRA ticket for that idea and link this thread?

Re: Hide threading header

Posted: Fri Jun 14, 2013 9:13 pm
by Transporter
spacegaier wrote:Can you please create a JIRA ticket for that idea and link this thread?
Done. https://ogre3d.atlassian.net/browse/OGRE-206

Re: Hide threading header

Posted: Tue Jun 25, 2013 4:24 pm
by sparkprime
I think this is necessary if you want fast mutexes -- everything has to be inlineable.

Ideally, the reuqired Boost include would be less planetary in scale, but that's a separate issue.