[Boost-bugs] [Boost C++ Libraries] #7045: Thread library does not automatically compile date_time

Subject: [Boost-bugs] [Boost C++ Libraries] #7045: Thread library does not automatically compile date_time
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-06-28 17:38:24


#7045: Thread library does not automatically compile date_time
-----------------------+----------------------------------------------------
 Reporter: anonymous | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.49.0
 Severity: Problem | Keywords:
-----------------------+----------------------------------------------------
 Hi,

 this is a problem for Visual Studio only (both VC10 and VC11), not a
 problem for MinGW:

 when building boost including the thread library with

 {{{
 bjam toolset=msvc-11.0 --build-type=complete --with-thread
 }}}

 it does not also build "date_time". Later when compiling a project that
 depends on boost thread, linker errors will demand "date_time".

 Interestingly this automatic dependency resolution is implemented
 correctly for MinGW:

 {{{
 bjam toolset=gcc --build-type=complete --with-thread
 }}}

 Here thread is dependent form "chono" and "system" (new with boost 1.50!).
 But it is not required to specify "--with-chrono --with-system".

 The "thread" libs internal dependencies are an implementation detail and
 should not concern the end user when building boost! It's quite a
 nuissance having to build boost all over again after realizing the linker
 is missing a dependency a long time later.

 PS: "chono" and "system" are a new thread dependency for MinGW since 1.50:
 Is this "by accident" or on purpose?

 PPS: *Please* clean up all the warnings in <boost/thread.hpp>. Yes
 std::thread is on the horizon, but not on Visual studio until VC11. And
 VC11 has it's own issues which makes it just not ready for prime time. Not
 to mention the problem of missing interuption in std::thread.
 So boost/thread is a viable solution for a significant time to come.

 Currently this abomination is required to have a clean build with boost
 thread:
 (for Mingw/GCC 4.7, VC10, VC11 and Linux GCC 4.6)
 {{{
 #ifdef __MINGW32__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wswitch-enum"
 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
 #pragma GCC diagnostic ignored "-Wshadow"
 #endif
 #ifdef _MSC_VER
 #pragma warning(disable : 4702) //unreachable code
 #endif

 #include <boost/thread.hpp>

 #ifdef __MINGW32__
 #pragma GCC diagnostic pop
 #endif
 #ifdef _MSC_VER
 #pragma warning(default : 4702) //unreachable code
 #endif
 }}}

 Thanks, ZenJu (zhnmju123_at_[hidden])

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7045>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC