Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for modular build structure. #403

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
48 changes: 48 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

require-b2 5.2 ;

constant boost_dependencies :
/boost/assert//boost_assert
/boost/atomic//boost_atomic
/boost/bind//boost_bind
/boost/chrono//boost_chrono
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/container//boost_container
/boost/container_hash//boost_container_hash
/boost/core//boost_core
/boost/date_time//boost_date_time
/boost/exception//boost_exception
/boost/function//boost_function
/boost/io//boost_io
/boost/move//boost_move
/boost/optional//boost_optional
/boost/predef//boost_predef
/boost/preprocessor//boost_preprocessor
/boost/smart_ptr//boost_smart_ptr
/boost/static_assert//boost_static_assert
/boost/system//boost_system
/boost/throw_exception//boost_throw_exception
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility
/boost/winapi//boost_winapi ;

project /boost/thread
: common-requirements
<include>include
;

explicit
[ alias boost_thread : build//boost_thread ]
[ alias all : boost_thread example test ]
;

call-if : boost-library thread
: install boost_thread
;

28 changes: 18 additions & 10 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@
import os ;
import indirect ;
import path ;
import configure ;
import configure ;
import threadapi-feature ;

exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ;

project boost/thread
project
: source-location ../src
: common-requirements <library>$(boost_dependencies)
: requirements <threading>multi
#<link>static:<define>BOOST_THREAD_STATIC_LINK=1
#<link>shared:<define>BOOST_THREAD_DYN_LINK=1
<link>static:<define>BOOST_THREAD_BUILD_LIB=1
<link>shared:<define>BOOST_THREAD_BUILD_DLL=1
-<tag>@%boostcpp.tag
-<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
<tag>@$(__name__).tag
<toolset>gcc:<cxxflags>-Wno-long-long
Expand Down Expand Up @@ -139,6 +141,7 @@ project boost/thread
#<define>BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
#<define>BOOST_SYSTEM_NO_DEPRECATED
#<define>BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
<define>BOOST_THREAD_NO_LIB=1
;

rule tag ( name : type ? : property-set )
Expand All @@ -156,8 +159,15 @@ rule tag ( name : type ? : property-set )
}

# forward to the boost tagging rule
return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
$(result) : $(type) : $(property-set) ] ;
if $(BOOST_JAMROOT_MODULE)
{
return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
$(result) : $(type) : $(property-set) ] ;
}
else
{
return $(result) ;
}
}

rule win32_pthread_paths ( properties * )
Expand Down Expand Up @@ -269,10 +279,10 @@ rule requirements ( properties * )
}
}
result += <define>BOOST_THREAD_DONT_USE_CHRONO ;
if ! [ configure.builds has_atomic_flag_lockfree
: $(properties) : "lockfree boost::atomic_flag" ] {
result += <library>/boost/atomic//boost_atomic ;
}
if ! [ configure.builds has_atomic_flag_lockfree
: $(properties) : "lockfree boost::atomic_flag" ] {
result += <library>/boost/atomic//boost_atomic ;
}
} else {
if <threadapi>win32 in $(properties)
{
Expand Down Expand Up @@ -315,5 +325,3 @@ lib boost_thread
<link>static:<define>BOOST_THREAD_USE_LIB=1
<conditional>@usage-requirements
;

boost-install boost_thread ;
2 changes: 1 addition & 1 deletion example/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

project boost/thread/example
project
: requirements <library>../build//boost_thread <threading>multi
;

Expand Down
19 changes: 9 additions & 10 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,15 @@ rule generate_self_contained_header_tests

if ! [ os.environ BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{
local headers_path = [ path.make $(BOOST_ROOT)/libs/thread/include/boost/thread ] ;
for file in [ path.glob-tree $(headers_path) : *.hpp : detail pthread win32 ]
for file in [ glob-tree-ex ../include/boost/thread : *.hpp : detail pthread win32 ]
{
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
local rel_file = [ path.relative-to ../include/boost/thread $(file) ] ;
# Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
# 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) <use>../build//boost_thread : $(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 <use>../build//boost_thread : $(test_name)-post_winh ] ;
}
}

Expand Down Expand Up @@ -1012,7 +1011,7 @@ rule generate_self_contained_header_tests
#[ thread-run test_10128.cpp ]
#[ thread-run test_10340.cpp ]
;

explicit ts_more_cpp11 ;
test-suite ts_more_cpp11
:
Expand All @@ -1033,13 +1032,13 @@ rule generate_self_contained_header_tests
:
[ thread-run2-noit ./experimental/parallel/v1/exception_list_pass.cpp : exception_list_p ]
;

#explicit ts_task_region ;
test-suite ts_task_region
:
[ thread-run2-noit ./experimental/parallel/v2/task_region_pass.cpp : task_region_p ]
;

explicit ts_other ;
test-suite ts_other
:
Expand All @@ -1050,7 +1049,7 @@ rule generate_self_contained_header_tests
explicit ts_ ;
test-suite ts_
:
#[ thread-run test_11256.cpp ]
#[ thread-run test_11256.cpp ]
#[ thread-run test_11256.cpp ]
#[ thread-run test_11499.cpp ]
#[ thread-run test_11611.cpp ]
Expand All @@ -1060,7 +1059,7 @@ rule generate_self_contained_header_tests
#[ thread-run test_12949.cpp ]
#[ thread-run test_13480b.cpp ]
[ thread-run test_13561.cpp ]

;

explicit test_time_jumps_1_obj ;
Expand Down
Loading