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

Modular build (alternative) #1035

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 0 additions & 15 deletions Jamfile

This file was deleted.

6 changes: 3 additions & 3 deletions bench/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# Official repository: https://github.com/boostorg/json
#

import bench ;
import common ;
import feature ;
import notfile ;
import os ;
import path ;
import property ;
import bench.jam ;

import feature ;

path-constant HERE : . ;

Expand Down
33 changes: 33 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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/align//boost_align
/boost/assert//boost_assert
/boost/config//boost_config
/boost/container//boost_container
/boost/container_hash//boost_container_hash
/boost/core//boost_core
/boost/describe//boost_describe
/boost/endian//boost_endian
/boost/mp11//boost_mp11
/boost/static_assert//boost_static_assert
/boost/system//boost_system
/boost/throw_exception//boost_throw_exception ;

project /boost/json ;

alias boost_json : build//boost_json ;
alias json_deps : build//json_deps ;
alias json_sources : build//json_sources ;

alias all : boost_json json_deps json_sources bench example fuzzing test ;

call-if
: boost-library json
: install boost_json
;
41 changes: 13 additions & 28 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#

import modules ;
import ../../config/checks/config ;
import-search /boost/config/checks ;
import config ;

# These make sure we only build on compatible C++11 or later toolchains.
obj cxx11_basic_alignas : ../check/basic_alignas.cpp ;
Expand Down Expand Up @@ -54,7 +55,12 @@ rule warn-if-requested ( properties * )
}
}

project boost/json
project
: common-requirements
<include>../include
<use>$(boost_dependencies)/<warnings-as-errors>off
<link>shared:<define>BOOST_JSON_DYN_LINK=1
<link>static:<define>BOOST_JSON_STATIC_LINK=1
: requirements
[ requires
config/cxx11_constexpr
Expand All @@ -66,34 +72,13 @@ project boost/json
# so we have to use a custom check
cxx11_basic_alignas
]
<link>shared:<define>BOOST_JSON_DYN_LINK=1
<link>static:<define>BOOST_JSON_STATIC_LINK=1
<define>BOOST_JSON_SOURCE
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
: usage-requirements
<link>shared:<define>BOOST_JSON_DYN_LINK=1
<link>static:<define>BOOST_JSON_STATIC_LINK=1
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<library>/boost/container//boost_container/<warnings-as-errors>off
<define>BOOST_JSON_NO_LIB=1
: source-location ../src
;

alias json_deps
: usage-requirements
<library>/boost//container/<warnings-as-errors>off
;

alias json_sources
: src.cpp
: usage-requirements
<library>/boost//container/<warnings-as-errors>off
;

explicit json_deps json_sources ;

lib boost_json
: json_sources
: usage-requirements
<library>/boost//container/<warnings-as-errors>off
;

boost-install boost_json ;
alias json_deps ;
alias json_sources : src.cpp ;
lib boost_json : json_sources ;
4 changes: 3 additions & 1 deletion doc/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

project json/doc ;

import-search /boost/docca ;

import boostbook ;
import ../../../tools/docca/docca.jam ;
import docca ;
import path ;

local include-prefix = [ path.root $(__file__:D) [ path.pwd ] ] ;
Expand Down
1 change: 1 addition & 0 deletions fuzzing/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import os ;
import path ;
import property ;
import sequence ;
import testing ;


# set the maximum size of the input, to avoid
Expand Down
20 changes: 8 additions & 12 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ project
: requirements
<include>.
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
;

for local f in $(SOURCES)
Expand All @@ -71,26 +72,21 @@ for local f in $(SOURCES)
extra-reqs += <toolset>msvc:<cxxflags>/bigobj ;
}

run $(f) main.cpp /boost/json//boost_json
: requirements
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
$(extra-reqs)
;
run $(f) main.cpp /boost/json//boost_json : requirements $(extra-reqs) ;
}

run limits.cpp main.cpp /boost/json//json_sources
: requirements
<define>BOOST_JSON_SOURCE
<define>BOOST_JSON_MAX_STRING_SIZE=1000
<define>BOOST_JSON_MAX_STRUCTURED_SIZE=20
<define>BOOST_JSON_STACK_BUFFER_SIZE=256
<define>BOOST_JSON_MAX_STRING_SIZE=1000
<define>BOOST_JSON_MAX_STRUCTURED_SIZE=20
<define>BOOST_JSON_STACK_BUFFER_SIZE=256
;

run no_exceptions.cpp main.cpp /boost/json//json_sources
: requirements
<exception-handling>off
<toolset>msvc:<cxxflags>"/wd4530" # C++ exception handler used
<toolset>msvc:<cxxflags>"/wd4577" # noexcept used without /EHsc
<exception-handling>off
<toolset>msvc:<cxxflags>"/wd4530" # C++ exception handler used
<toolset>msvc:<cxxflags>"/wd4577" # noexcept used without /EHsc
;

run intrusive_macros.cpp main.cpp /boost/json//json_deps ;
Loading