Skip to content

Commit

Permalink
Set C++11 requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Sep 12, 2023
1 parent e62d29f commit 755e463
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 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 @@ -249,13 +250,17 @@ rule usage-requirements ( properties * )
return $(result) ;
}

local cxx_requirements = [ requires
cxx11_noexcept # from lexical_cast
] ;

rule requirements ( properties * )
{
local result ;

if <threadapi>pthread in $(properties)
{
result += <define>BOOST_THREAD_POSIX ;
result += <define>BOOST_THREAD_POSIX $(cxx_requirements) ;
if <target-os>windows in $(properties)
{
local paths = [ win32_pthread_paths $(properties) ] ;
Expand Down
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 755e463

Please sign in to comment.