Skip to content

Commit

Permalink
Set C++11 requirements
Browse files Browse the repository at this point in the history
Boost.DateTime is used which uses lexical_cast
Boost.LexicalCast is used directly in the pthread case

Both are header-only hence set the requirements here.
  • Loading branch information
Flamefire committed Sep 13, 2023
1 parent e62d29f commit 08cf7c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 8 additions & 1 deletion build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import os ;
import indirect ;
import path ;
import config : requires ;
import configure ;
import threadapi-feature ;

Expand Down Expand Up @@ -307,13 +308,19 @@ alias thread_sources

explicit thread_sources ;

local cxx_requirements = [ requires
cxx11_noexcept # from lexical_cast, possibly through date_time
] ;

lib boost_thread
: thread_sources
: <conditional>@requirements
$(cxx_requirements)
:
: <link>shared:<define>BOOST_THREAD_USE_DLL=1
<link>static:<define>BOOST_THREAD_USE_LIB=1
<conditional>@usage-requirements
$(cxx_requirements)
;

boost-install boost_thread ;
boost-install boost_thread ;
9 changes: 7 additions & 2 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# bring in rules for testing
import testing ;
import config : requires ;
import regex ;
import path ;
import os ;
Expand Down Expand Up @@ -268,6 +269,10 @@ rule generate_self_contained_header_tests

if ! [ os.environ BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{
local cxx_requirements = [ requires
cxx11_static_assert # from atomic
] ;

local headers_path = [ path.make $(BOOST_ROOT)/libs/thread/include/boost/thread ] ;
for file in [ path.glob-tree $(headers_path) : *.hpp : detail pthread win32 ]
{
Expand All @@ -276,8 +281,8 @@ rule generate_self_contained_header_tests
# All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
#ECHO $(rel_file) ;
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(test_name) ] ;
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <define>"BOOST_THREAD_TEST_POST_WINDOWS_H" <dependency>$(file) <conditional>@windows-cygwin-specific : $(test_name)-post_winh ] ;
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <dependency>$(file) $(cxx_requirements) : $(test_name) ] ;
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <define>"BOOST_THREAD_TEST_POST_WINDOWS_H" <dependency>$(file) <conditional>@windows-cygwin-specific $(cxx_requirements) : $(test_name)-post_winh ] ;
}
}

Expand Down

0 comments on commit 08cf7c4

Please sign in to comment.