2
0
mirror of https://github.com/boostorg/wave.git synced 2026-01-19 04:42:16 +00:00

Add support for modular build structure. (#214)

* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add wave tool build to all target.

* Add missing NO_LIB usage requirements.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
This commit is contained in:
René Ferdinand Rivera Morell
2024-08-27 00:01:03 -05:00
committed by GitHub
parent 0e7388b8ae
commit 7ce8b53d9d
13 changed files with 154 additions and 65 deletions

43
build.jam Normal file
View File

@@ -0,0 +1,43 @@
# Copyright René Ferdinand Rivera Morell 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/concept_check//boost_concept_check
/boost/config//boost_config
/boost/core//boost_core
/boost/filesystem//boost_filesystem
/boost/format//boost_format
/boost/iterator//boost_iterator
/boost/lexical_cast//boost_lexical_cast
/boost/mpl//boost_mpl
/boost/multi_index//boost_multi_index
/boost/optional//boost_optional
/boost/pool//boost_pool
/boost/preprocessor//boost_preprocessor
/boost/serialization//boost_serialization
/boost/smart_ptr//boost_smart_ptr
/boost/spirit//boost_spirit
/boost/static_assert//boost_static_assert
/boost/throw_exception//boost_throw_exception
/boost/type_traits//boost_type_traits ;
project /boost/wave
: common-requirements
<include>include
;
explicit
[ alias boost_wave : build//boost_wave ]
[ alias wave : tool/build//wave ]
[ alias all : boost_wave wave samples test ]
;
call-if : boost-library wave
: install boost_wave
;

View File

@@ -8,9 +8,12 @@
# Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import ../../config/checks/config : requires ;
require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
project boost/wave
project
: common-requirements <library>$(boost_dependencies)
: requirements
[ requires
cxx11_constexpr
@@ -25,6 +28,8 @@ project boost/wave
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
: source-location ../src
: usage-requirements
<define>BOOST_ALL_NO_LIB=1
;
SOURCES =
@@ -45,8 +50,8 @@ SOURCES =
lib boost_wave
:
$(SOURCES)
../../filesystem/build//boost_filesystem
../../thread/build//boost_thread
/boost/filesystem//boost_filesystem
/boost/thread//boost_thread
;
for local source in $(SOURCES)
@@ -69,5 +74,3 @@ for local source in $(SOURCES)
obj $(source) : $(source).cpp : $(requirements) ;
}
boost-install boost_wave ;

View File

@@ -3,6 +3,8 @@
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
project

View File

@@ -11,7 +11,7 @@
=============================================================================*/
#include "check_macro_naming.hpp"
#include "libs/filesystem/include/boost/filesystem/file_status.hpp"
#include "boost/filesystem/file_status.hpp"
///////////////////////////////////////////////////////////////////////////////
// Utilities from the rest of Boost

View File

@@ -8,6 +8,8 @@
# Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
project : requirements <library>/boost/wave//boost_wave ;
SOURCES =
../cpp_tokens
../instantiate_cpp_exprgrammar
@@ -21,7 +23,6 @@ SOURCES =
exe cpp_tokens
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options
/boost/filesystem//boost_filesystem
/boost/system//boost_system

View File

@@ -18,14 +18,18 @@ SOURCES =
../instantiate_lexertl_lexer
;
project
: requirements
<library>/boost/wave//boost_wave
<library>/boost/program_options//boost_program_options/<link>static
<library>/boost/filesystem//boost_filesystem
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
;
exe list_includes
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options/<link>static
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/thread//boost_thread
;
for local source in $(SOURCES)

View File

@@ -16,14 +16,19 @@ SOURCES =
../instantiate_has_include_grammar
;
project
: requirements
<library>/boost/wave//boost_wave
<library>/boost/program_options//boost_program_options/<link>static
<library>/boost/filesystem//boost_filesystem
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
<library>/boost/xpressive//boost_xpressive
;
exe token_statistics
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options/<link>static
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/thread//boost_thread
;
for local source in $(SOURCES)

View File

@@ -19,14 +19,18 @@ SOURCES =
../idllexer/idl_re
;
project
: requirements
<library>/boost/wave//boost_wave
<library>/boost/program_options//boost_program_options/<link>static
<library>/boost/system//boost_system
<library>/boost/thread//boost_thread
<library>/boost/filesystem//boost_filesystem
;
exe waveidl
:
$(SOURCES)
/boost/wave//boost_wave
/boost/program_options//boost_program_options/<link>static
/boost/system//boost_system
/boost/thread//boost_thread
/boost/filesystem//boost_filesystem
;
for local source in $(SOURCES)

View File

@@ -8,7 +8,11 @@
# 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.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
import project ;
import path ;
#
# These are the sources to compile for the testwave application
@@ -22,9 +26,23 @@ SOURCES_DYNAMIC = testwave_dll testwave_app_dll
SOURCES = $(SOURCE_STATIC) $(SOURCES_DYNAMIC)
;
path-constant TESTWAVE_DIR : $(BOOST_ROOT)/libs/wave/test/testwave/testfiles
path-constant TESTWAVE_DIR : ../testwave/testfiles
;
path-constant WAVE_INCLUDE_DIR : ../../include
;
path-constant SAMPLES_DIR : ../../samples
;
#
# We need the Boost Config project for the boost/version.hpp header file.
#
local boost-config-attributes
= [ project.attributes [ project.is-registered-id /boost/config ] ] ;
local BOOST_CONFIG_INCLUDE_DIR
= [ path.join [ $(boost-config-attributes).get location ] include ] ;
#
# This are the arguments for the testwave executable
#
@@ -32,7 +50,8 @@ TESTWAVE_ARGUMENTS =
-d4 # use -d4 for verbose results
--hooks=1 # test hooks as well
-S$(TESTWAVE_DIR)
-S$(BOOST_ROOT) -I$(BOOST_ROOT)
-S$(WAVE_INCLUDE_DIR) -I$(WAVE_INCLUDE_DIR)
-S$(BOOST_CONFIG_INCLUDE_DIR) -I$(BOOST_CONFIG_INCLUDE_DIR)
;
#
@@ -41,7 +60,7 @@ TESTWAVE_ARGUMENTS =
TESTWAVE_FILES = test.cfg
;
project wave/test
project
: requirements
[ requires
cxx11_constexpr
@@ -51,6 +70,7 @@ project wave/test
cxx11_hdr_mutex
cxx11_hdr_regex
]
<include>$(SAMPLES_DIR)
;
for local source in $(SOURCES)
@@ -58,6 +78,10 @@ for local source in $(SOURCES)
local requirements ;
requirements += <toolset-msvc:version>7.1:<rtti>off ; # workaround for compiler bug
requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ;
requirements +=
<source>/boost/any//boost_any
<source>/boost/program_options//boost_program_options
;
obj $(source) : ../testwave/$(source).cpp : $(requirements) ;
}
@@ -133,6 +157,7 @@ test-suite wave
/boost/filesystem//boost_filesystem
/boost/thread//boost_thread
/boost/system//boost_system
/boost/xpressive//boost_xpressive
:
# arguments
:
@@ -211,6 +236,7 @@ test-suite wave
/boost/filesystem//boost_filesystem
/boost/thread//boost_thread
/boost/system//boost_system
/boost/xpressive//boost_xpressive
:
# arguments
:

View File

@@ -24,7 +24,7 @@
// include the lexertl lexer related stuff
#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type
#include <libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp> // lexer type
#include <list_includes/lexertl/lexertl_lexer.hpp> // lexer type
typedef boost::wave::cpplexer::lex_token<> token_type;
typedef boost::wave::cpplexer::lexertl::lex_iterator<token_type> lexer_type;

View File

@@ -27,8 +27,8 @@
///////////////////////////////////////////////////////////////////////////////
// include the Slex lexer related stuff
#include <libs/wave/samples/cpp_tokens/slex_token.hpp> // token type
#include <libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp> // lexer type
#include <cpp_tokens/slex_token.hpp> // token type
#include <cpp_tokens/slex/cpp_slex_lexer.hpp> // lexer type
typedef boost::wave::cpplexer::slex_token<> token_type;
typedef boost::wave::cpplexer::slex::slex_iterator<token_type> lexer_type;

View File

@@ -26,8 +26,8 @@
///////////////////////////////////////////////////////////////////////////////
// include the Xpressive lexer related stuff
#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type
#include <libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp> // lexer type
#include <libs/wave/samples/token_statistics/xlex_iterator.hpp> // iterator
#include <token_statistics/xlex/xlex_lexer.hpp> // lexer type
#include <token_statistics/xlex_iterator.hpp> // iterator
typedef boost::wave::cpplexer::lex_token<> token_type;
typedef boost::wave::cpplexer::xlex::xlex_iterator<token_type> lexer_type;

View File

@@ -34,13 +34,14 @@ project
exe wave
:
../cpp.cpp
/boost//wave
/boost//program_options
/boost//filesystem
/boost//serialization
/boost//system
/boost//thread
/boost/wave//boost_wave
/boost/program_options//boost_program_options
/boost/filesystem//boost_filesystem
/boost/serialization//boost_serialization
/boost/system//boost_system
/boost/thread//boost_thread
/boost/timer//boost_timer/<link>static
/boost/foreach//boost_foreach
:
<threading>multi
# <debug-symbols>on
@@ -49,8 +50,8 @@ exe wave
release
;
local bindir = [ option.get bindir : ../../../dist/bin ] ;
local libdir = [ option.get libdir : ../../../dist/lib ] ;
local bindir = [ option.get bindir : ../dist/bin ] ;
local libdir = [ option.get libdir : ../dist/lib ] ;
install dist-bin
: