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. #172

Merged
merged 25 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fdf5222
Make the library modular usable.
grafikrobot Mar 11, 2024
e517c3c
Switch to library requirements instead of source. As source puts extr…
grafikrobot Mar 30, 2024
9ad793b
Add missing install library.
grafikrobot Apr 7, 2024
6a0ce91
Sync from upstream.
grafikrobot Apr 10, 2024
8951448
Sync from upstream.
grafikrobot Apr 20, 2024
fce8a79
Add missing b2 testing module import.
grafikrobot Apr 25, 2024
19c7c79
Add missing NO_LIB usage requirements.
grafikrobot Apr 29, 2024
a9b59f3
Update library dependencies.
grafikrobot Apr 30, 2024
1047e18
Add missing import-search for cconfig/predef checks.
grafikrobot May 5, 2024
c82b180
Add requires-b2 check to top-level build file.
grafikrobot May 5, 2024
8c86182
Update dependencies.
grafikrobot May 14, 2024
7b408b6
Sync from upstream.
grafikrobot May 30, 2024
bcaa49a
Sync from upstream.
grafikrobot Jun 11, 2024
9266104
Sync from upstream.
grafikrobot Jun 11, 2024
4ec7c37
Bump B2 require to 5.2
grafikrobot Jun 14, 2024
2cdbcf1
Sync from upstream.
grafikrobot Jun 16, 2024
2a70604
Sync from upstream.
grafikrobot Jul 12, 2024
8364c6c
Update copyright dates.
grafikrobot Jul 21, 2024
49477cc
Move inter-lib dependencies to a project variable and into the build …
grafikrobot Jul 24, 2024
d8ba580
Split b2 dependencies into public and private.
grafikrobot Jul 26, 2024
a273260
Adjust doc build to avoid boost-root references.
grafikrobot Jul 28, 2024
b738329
Update build deps.
grafikrobot Aug 9, 2024
a157f78
Update build deps.
grafikrobot Aug 17, 2024
b27094c
Trigger CI run
apolukhin Aug 25, 2024
7f29662
Remove unneeded link to boost_stacktrace lib which is noop for testin…
grafikrobot Sep 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 :
<library>/boost/config//boost_config
<library>/boost/container_hash//boost_container_hash
<library>/boost/core//boost_core
<library>/boost/predef//boost_predef
<target-os>windows:<library>/boost/winapi//boost_winapi ;

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

explicit
[ alias boost_stacktrace_addr2line : build//boost_stacktrace_addr2line ]
[ alias boost_stacktrace_backtrace : build//boost_stacktrace_backtrace ]
[ alias boost_stacktrace_basic : build//boost_stacktrace_basic ]
[ alias boost_stacktrace_from_exception : build//boost_stacktrace_from_exception ]
[ alias boost_stacktrace_noop : build//boost_stacktrace_noop ]
[ alias boost_stacktrace_windbg : build//boost_stacktrace_windbg ]
[ alias boost_stacktrace_windbg_cached : build//boost_stacktrace_windbg_cached ]
[ alias boost_stacktrace : boost_stacktrace_noop ]
[ alias all :
boost_stacktrace_addr2line
boost_stacktrace_backtrace
boost_stacktrace_basic
boost_stacktrace_from_exception
boost_stacktrace_noop
boost_stacktrace_windbg
boost_stacktrace_windbg_cached
test
]
;

call-if : boost-library stacktrace
: install
boost_stacktrace_addr2line
boost_stacktrace_backtrace
boost_stacktrace_basic
boost_stacktrace_from_exception
boost_stacktrace_noop
boost_stacktrace_windbg
boost_stacktrace_windbg_cached
;
36 changes: 24 additions & 12 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@
# http://www.boost.org/LICENSE_1_0.txt)
#

require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
import feature ;
import property ;
import ../../config/checks/config : requires ;

constant boost_dependencies_private :
<library>/boost/assert//boost_assert
;

project
: source-location .
: common-requirements $(boost_dependencies)
: requirements
[ requires cxx11_rvalue_references ]
$(boost_dependencies_private)
: default-build
<visibility>hidden
;
Expand All @@ -26,10 +33,10 @@ feature.feature boost.stacktrace.from_exception : on off : optional propagated ;

local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ;
lib backtrace
:
:
: <search>$(LIBBACKTRACE_PATH)/lib <link>static
:
: <include>$(LIBBACKTRACE_PATH)/include
: <include>$(LIBBACKTRACE_PATH)/include
;

actions mp_simple_run_action
Expand Down Expand Up @@ -67,6 +74,7 @@ lib boost_stacktrace_noop
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

lib boost_stacktrace_backtrace
Expand All @@ -77,10 +85,11 @@ lib boost_stacktrace_backtrace
<target-os>linux:<library>dl
<library>backtrace
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
[ check-target-builds ../build//libbacktrace : : <build>no ]
[ check-target-builds libbacktrace : : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

lib boost_stacktrace_addr2line
Expand All @@ -90,10 +99,11 @@ lib boost_stacktrace_addr2line
<warnings>all
<target-os>linux:<library>dl
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
[ check-target-builds ../build//addr2line : : <build>no ]
[ check-target-builds addr2line : : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

lib boost_stacktrace_basic
Expand All @@ -103,10 +113,11 @@ lib boost_stacktrace_basic
<warnings>all
<target-os>linux:<library>dl
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
[ check-target-builds ../build//WinDbg : <build>no ]
[ check-target-builds WinDbg : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

lib boost_stacktrace_windbg
Expand All @@ -116,10 +127,11 @@ lib boost_stacktrace_windbg
<warnings>all
<library>Dbgeng <library>ole32
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
[ check-target-builds ../build//WinDbg : : <build>no ]
[ check-target-builds WinDbg : : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

lib boost_stacktrace_windbg_cached
Expand All @@ -129,10 +141,11 @@ lib boost_stacktrace_windbg_cached
<warnings>all
<library>Dbgeng <library>ole32
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
[ check-target-builds ../build//WinDbgCached : : <build>no ]
[ check-target-builds WinDbgCached : : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

rule build-stacktrace-from-exception ( props * )
Expand Down Expand Up @@ -162,10 +175,9 @@ lib boost_stacktrace_from_exception
<conditional>@build-stacktrace-from-exception

# Require usable libbacktrace on other platforms
#[ check-target-builds ../build//libbacktrace : : <build>no ]
# [ check-target-builds libbacktrace : : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;

boost-install boost_stacktrace_noop boost_stacktrace_backtrace boost_stacktrace_addr2line boost_stacktrace_basic boost_stacktrace_windbg boost_stacktrace_windbg_cached boost_stacktrace_from_exception ;
6 changes: 3 additions & 3 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import doxygen ;

doxygen autodoc
:
[ glob ../../../boost/stacktrace.hpp ]
[ glob ../../../boost/stacktrace/*.hpp ]
[ glob ../../../boost/stacktrace/detail/frame_decl.hpp ]
[ glob ../include/boost/stacktrace.hpp ]
[ glob ../include/boost/stacktrace/*.hpp ]
[ glob ../include/boost/stacktrace/detail/frame_decl.hpp ]
:
<doxygen:param>EXTRACT_ALL=NO
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
Expand Down
2 changes: 1 addition & 1 deletion example/user_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#define BOOST_USER_CONFIG <libs/stacktrace/example/user_config.hpp>
#define BOOST_USER_CONFIG <example/user_config.hpp>

#include <boost/array.hpp>
#include <exception> // std::set_terminate, std::abort
Expand Down
17 changes: 13 additions & 4 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# http://www.boost.org/LICENSE_1_0.txt)
#

import ../../config/checks/config : requires ;
import-search /boost/config/checks ;
import config : requires ;
import testing ;

lib dl : : <link>shared ;
lib gcc_s ;
Expand All @@ -31,6 +33,8 @@ project
<warnings>all
<test-info>always_show_run_output
<visibility>hidden
<include>..
<library>/boost/optional//boost_optional
;

local FORCE_SYMBOL_EXPORT = <target-os>freebsd:<linkflags>"-rdynamic" <target-os>solaris:<linkflags>"-Bdynamic" <target-os>aix:<linkflags>"-rdynamic"
Expand Down Expand Up @@ -122,15 +126,19 @@ test-suite stacktrace_tests
[ run thread_safety_checking.cpp
: : : <debug-symbols>on <library>.//test_impl_lib_backtrace $(LINKSHARED_BT)
<define>BOOST_STACKTRACE_BACKTRACE_FORCE_STATIC
<library>/boost/optional//boost_optional
: backtrace_lib_threaded_static ]
[ run thread_safety_checking.cpp
: : : <debug-symbols>on <library>.//test_impl_lib_windbg $(LINKSHARED_WIND)
<library>/boost/optional//boost_optional
: windbg_lib_threaded ]
[ run thread_safety_checking.cpp
: : : <debug-symbols>on <library>.//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED)
<library>/boost/optional//boost_optional
: windbg_cached_lib_threaded ]
[ run thread_safety_checking.cpp
: : : <debug-symbols>on <library>.//test_impl_lib_basic $(LINKSHARED_BASIC)
<library>/boost/optional//boost_optional
: basic_lib_threaded ]

##### Tests with disabled debug symbols #####
Expand Down Expand Up @@ -158,6 +166,7 @@ test-suite stacktrace_tests
[ run thread_safety_checking.cpp
: : : <debug-symbols>off
<library>.//test_impl_lib_backtrace_no_dbg
<library>/boost/optional//boost_optional
$(LINKSHARED_BT)
: backtrace_lib_no_dbg_threaded ]
[ run thread_safety_checking.cpp
Expand Down Expand Up @@ -212,15 +221,15 @@ test-suite stacktrace_tests
for local p in [ glob ../example/*.cpp ]
{
local target_name = $(p[1]:B) ;
local additional_dependency = ;
local additional_dependency = <library>/boost/array//boost_array ;
if $(target_name) = "terminate_handler"
{
additional_dependency = <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt ;
additional_dependency += <library>/boost/filesystem//boost_filesystem <library>/boost/system//boost_system <target-os>linux:<library>rt ;
}

if $(target_name) = "throwing_st"
{
additional_dependency = [ requires rtti ] ;
additional_dependency += [ requires rtti ] <library>/boost/exception//boost_exception ;
}

stacktrace_tests += [ run $(p) : : : <debug-symbols>on $(LINKSHARED_BT) $(additional_dependency) : backtrace_$(p2[1]:B) ] ;
Expand Down
Loading