From 755e463153c221d3fff157eb253b281122e4b864 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 12 Sep 2023 09:11:41 +0200 Subject: [PATCH] Set C++11 requirements --- build/Jamfile.v2 | 7 ++++++- test/Jamfile.v2 | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 1a88d0102..93bb607bd 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -35,6 +35,7 @@ import os ; import indirect ; import path ; +import config : requires ; import configure ; import threadapi-feature ; @@ -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 pthread in $(properties) { - result += BOOST_THREAD_POSIX ; + result += BOOST_THREAD_POSIX $(cxx_requirements) ; if windows in $(properties) { local paths = [ win32_pthread_paths $(properties) ] ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 33a83c7c1..c528ceb38 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -18,6 +18,7 @@ # bring in rules for testing import testing ; +import config : requires ; import regex ; import path ; import os ; @@ -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 ] { @@ -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 : "BOOST_THREAD_TEST_HEADER=$(rel_file)" $(file) : $(test_name) ] ; - all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" "BOOST_THREAD_TEST_POST_WINDOWS_H" $(file) @windows-cygwin-specific : $(test_name)-post_winh ] ; + all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" $(file) $(cxx_requirements) : $(test_name) ] ; + all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" "BOOST_THREAD_TEST_POST_WINDOWS_H" $(file) @windows-cygwin-specific $(cxx_requirements) : $(test_name)-post_winh ] ; } }