2
0
mirror of https://github.com/boostorg/winapi.git synced 2026-01-19 04:52:07 +00:00

Add support for modular build structure. (#94)

* Make the library modular usable.

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

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

* Bump B2 require to 5.2

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

* Update copyright dates.

* Fix glob of tests.

* Move inter-lib dependencies to a project variable and into the build targets.
This commit is contained in:
René Ferdinand Rivera Morell
2024-08-18 17:33:17 -05:00
committed by GitHub
parent c5fb9c86e8
commit dfc89a660a
2 changed files with 33 additions and 4 deletions

24
build.jam Normal file
View File

@@ -0,0 +1,24 @@
# 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/config//boost_config
/boost/predef//boost_predef ;
project /boost/winapi
: common-requirements
<include>include
;
explicit
[ alias boost_winapi : : : : <library>$(boost_dependencies) ]
[ alias all : boost_winapi test ]
;
call-if : boost-library winapi
;

View File

@@ -15,15 +15,20 @@ lib advapi32 ;
lib bcrypt ;
lib user32 ;
local here = [ modules.binding $(__name__) ] ;
path-constant here : . ;
project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] config/has-bcrypt ] ;
project.load [ path.join [ path.make $(here) ] config/has-bcrypt ] ;
project.pop-current ;
project
: requirements
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<library>/boost/preprocessor//boost_preprocessor
<library>/boost/type_traits//boost_type_traits
# Disable warnings about using 'insecure' standard C functions
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
@@ -73,7 +78,7 @@ rule test_all
{
local all_rules ;
local file ;
local headers_path = [ path.make $(BOOST_ROOT)/libs/winapi/include/boost/winapi ] ;
local headers_path = ../include/boost/winapi ;
for file in [ path.glob-tree $(headers_path) : *.hpp : detail ]
{
local rel_file = [ path.relative-to [ path.parent $(headers_path) ] $(file) ] ;
@@ -91,7 +96,7 @@ rule test_all
all_rules += [ compile compile/windows_h_post.cpp : <conditional>@filter-target-os <define>"BOOST_WINAPI_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(post_winh_test_name) ] ;
}
headers_path = [ path.make $(BOOST_ROOT)/libs/winapi/include/boost/detail ] ;
headers_path = ../include/boost/detail ;
for file in [ path.glob $(headers_path) : *.hpp : detail ]
{
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;