Skip to content

Commit

Permalink
Add support for modular build structure
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot authored Aug 19, 2024
1 parent 00bc812 commit 69c457a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
36 changes: 36 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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/asio//boost_asio
/boost/assert//boost_assert
/boost/charconv//boost_charconv
/boost/config//boost_config
/boost/core//boost_core
/boost/describe//boost_describe
/boost/endian//boost_endian
/boost/intrusive//boost_intrusive
/boost/mp11//boost_mp11
/boost/optional//boost_optional
/boost/pfr//boost_pfr
/boost/system//boost_system
/boost/throw_exception//boost_throw_exception
/boost/variant2//boost_variant2 ;

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

explicit
[ alias boost_mysql : : : : <library>$(boost_dependencies) ]
[ alias all : boost_mysql example test ]
;

call-if : boost-library mysql
;

3 changes: 2 additions & 1 deletion doc/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ project mysql/doc ;

import boostbook ;
import os ;
import ../../../tools/docca/docca.jam ;
import-search /boost/docca ;
import docca ;


# Note: adding server-specific error codes and collations to the reference
Expand Down
3 changes: 3 additions & 0 deletions example/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import os ;

project : requirements <library>/boost/mysql//boost_mysql ;

path-constant this_dir : . ;

# The hostname to use for examples
Expand Down Expand Up @@ -110,6 +112,7 @@ run
/boost/mysql/test//boost_context_lib
/boost/json//boost_json
/boost/url//boost_url
/boost/beast//boost_beast
: requirements
<testing.launcher>"python $(this_dir)/private/run_connection_pool.py"
<testing.arg>$(hostname)
Expand Down
12 changes: 7 additions & 5 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
# 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 os ;
import path ;
import feature ;
import ac ;
import indirect ;
import ../config/checks/config : requires ;
import config : requires ;

project /boost/mysql/test ;
project : requirements <library>/boost/mysql//boost_mysql ;

# Support header-only builds
feature.feature boost.mysql.separate-compilation : on off : propagated composite ;
Expand Down Expand Up @@ -43,7 +46,7 @@ alias fail_if_no_openssl
explicit fail_if_no_openssl ;

# Requirements to use across targets
local requirements =
local requirements =
<define>BOOST_ALL_NO_LIB=1
<define>BOOST_ASIO_NO_DEPRECATED=1
<define>BOOST_ASIO_DISABLE_BOOST_ARRAY=1
Expand All @@ -53,7 +56,7 @@ local requirements =
<define>BOOST_ASIO_DISABLE_BOOST_COROUTINE=1
<define>BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS=1
<define>BOOST_ALLOW_DEPRECATED_HEADERS=1
# Disable warning C4702: unreachable code, produced by Boost.Asio buffer.hpp
# Disable warning C4702: unreachable code, produced by Boost.Asio buffer.hpp
<toolset>msvc:<cxxflags>"/bigobj /wd4702 /permissive-"
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS=1
<toolset>msvc:<define>_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
Expand All @@ -68,7 +71,6 @@ local requirements =
<target-os>linux:<define>_XOPEN_SOURCE=600
<target-os>linux:<define>_GNU_SOURCE=1
<target-os>windows:<define>_WIN32_WINNT=0x0601
<include>../include
<boost.mysql.use-ts-executor>on:<define>BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
# Disable assertions when doing coverage, as they distort coverage data
<coverage>on:<define>BOOST_DISABLE_ASSERTS
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ run
test/pfr.cpp
test/pipeline.cpp
test/with_diagnostics.cpp

: requirements
<include>include
: target-name boost_mysql_unittests
Expand Down

0 comments on commit 69c457a

Please sign in to comment.