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

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
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
29 changes: 29 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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 ;

import feature ;

feature.feature boost.nowide.lfs : auto no : optional propagated ;

constant boost_dependencies :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for the variable instead of inlining in build/Jamfile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason is to advertise the dependencies to others consistently for both buildable and header only libs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that's intended for ("others"=)humans, isn't it? Because otherwise I don't see how this is consistent with e.g. https://github.com/boostorg/variant2/blob/a4b167b7238781d75df5d6684c9e9d40b26456dc/build.jam#L17 given that are different files

My hesitation is because now when reading/editing the build/Jamfile I need to switch to this to see the definition of a variable used there. For head-only libs it is defined and used in the same file (as the build-Jamfile doesn't exist)

To be clear: I'm not saying this is bad, I just want to understand the motivation why.

/boost/config//boost_config
/boost/filesystem//boost_filesystem ;

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

explicit
[ alias boost_nowide : build//boost_nowide ]
[ alias all : boost_nowide test ]
;

call-if : boost-library nowide
: install boost_nowide
;

14 changes: 6 additions & 8 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Copyright (c) 2002, 2006 Beman Dawes
# Copyright (c) 2012 Artyom Beilis (Tonkikh)
# Copyright (c) 2020-2021 Alexander Grund
#
#
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
#
# See library home page at https://www.boost.org/libs/nowide

import ../../config/checks/config : requires ;
import-search /boost/config/checks ;
import config : requires ;
import configure ;
import feature ;

feature.feature boost.nowide.lfs : auto no : optional propagated ;

local requirements =
<link>shared:<define>BOOST_NOWIDE_DYN_LINK=1
<define>BOOST_NOWIDE_NO_LIB=1
;

project boost/nowide
project
: source-location ../src
: common-requirements <library>$(boost_dependencies)
: requirements $(requirements)
[ requires
cxx11_auto_declarations
Expand Down Expand Up @@ -46,5 +46,3 @@ lib boost_nowide
: $(SOURCES).cpp
: <include>../src
;

boost-install boost_nowide ;
6 changes: 3 additions & 3 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2003, 2006 Beman Dawes
# Copyright (c) 2012 Artyom Beilis (Tonkikh)
# Copyright (c) 2020-2022 Alexander Grund
#
#
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

Expand All @@ -23,11 +23,11 @@ project : requirements
<include>.
<warnings>pedantic
<warnings-as-errors>on
[ check-target-builds ../config//cxx11_moveable_fstreams "std::fstream is moveable and swappable" : : <build>no ]
[ check-target-builds ../config//cxx11_moveable_fstreams "std::fstream is moveable and swappable" : : <build>no ]
;

lib shell32 ;
lib file_test_helpers : file_test_helpers.cpp : <link>static -<library>/boost/nowide//boost_nowide ;
lib file_test_helpers : file_test_helpers.cpp : <link>static -<library>/boost/nowide//boost_nowide <use>/boost/nowide//boost_nowide ;
explicit file_test_helpers ;

run test_codecvt.cpp ;
Expand Down
Loading