[build] How to build a multi version non-header-library

Hi, I want to provide two versions for Boost.Thread, one using Boost.Chrono and the other not. Boost.Thread is a non-header-only library so I guess that I need to build two libraries with different names. Is there already a library in Boost in the same context on which I can base my build design? What is the simples way to do this with Boost.build? Any pointers to the doc? Thanks in advance, Vicente

The best approach is to use versioned namespaces, like boost::filesystem uses. If I'm not mistaken, inline namespace where introduced in C++11for this purpose. namespace boost { namespace thread_v1 { ... } } namespace boost { namespace thread_v2 { ... } } namespace boost { #if BOOST_THREAD_VERSION == 2 using thread_v2::thread; … #else using thread_v1::thread; ... #endif } The downside is that we don't have inline namespaces in C++03, which leaves a daunting task of putting all those "using xxx;" directives. Regards On 18/01/2012, at 00:00, Vicente J. Botet Escriba wrote:
Hi,
I want to provide two versions for Boost.Thread, one using Boost.Chrono and the other not. Boost.Thread is a non-header-only library so I guess that I need to build two libraries with different names. Is there already a library in Boost in the same context on which I can base my build design? What is the simples way to do this with Boost.build? Any pointers to the doc?
Thanks in advance, Vicente
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Sorry, I did not notice that it was boost-build specific question. Disregard my last post. On 18/01/2012, at 00:00, Vicente J. Botet Escriba wrote:
Hi,
I want to provide two versions for Boost.Thread, one using Boost.Chrono and the other not. Boost.Thread is a non-header-only library so I guess that I need to build two libraries with different names. Is there already a library in Boost in the same context on which I can base my build design? What is the simples way to do this with Boost.build? Any pointers to the doc?
Thanks in advance, Vicente
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Bruno Santos
-
Vicente J. Botet Escriba