From fd1d7a0a4ce22012e7e2083260d84780d1f702fe Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 15 Dec 2017 12:08:16 -0700 Subject: Allow install directly from the modular layout, without running b2 headers first. stage now runs headers automatically. --- boostcpp.jam | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'boostcpp.jam') diff --git a/boostcpp.jam b/boostcpp.jam index 85a4cb323f..dc7af601cc 100644 --- a/boostcpp.jam +++ b/boostcpp.jam @@ -20,6 +20,7 @@ import package ; import path ; import project ; import regex ; +import sequence ; import set ; import targets ; import feature ; @@ -234,7 +235,7 @@ rule filtered-target ( name : message + : sources + : requirements * ) $(p).mark-target-as-explicit $(name)-message ; } -rule declare_install_and_stage_proper_targets ( libraries * : headers * ) +rule declare_install_and_stage_proper_targets ( libraries * : headers * : modular-headers * ) { local p = [ project.current ] ; for local l in $(libraries) @@ -265,7 +266,7 @@ rule declare_install_and_stage_proper_targets ( libraries * : headers * ) } local library-targets = $(libraries)-for-install ; - install-requirements = $(BOOST_ROOT)/boost ; + local install-requirements ; if $(layout-versioned) { @@ -288,9 +289,40 @@ rule declare_install_and_stage_proper_targets ( libraries * : headers * ) p = [ project.current ] ; + # These headers will be installed from the modular + # layout, and should be ignored in the global boost/ + local skip-headers ; + # Install modular headers. + for local lib in $(modular-headers) + { + local header-root = $(BOOST_ROOT)/libs/$(lib)/include/boost ; + local lib-headers = + [ path.glob-tree $(header-root) : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ] + [ path.glob-tree $(header-root)/compatibility/cpp_c_headers : c* : CVS .svn ] + [ path.glob $(header-root)/tr1/tr1 : * : bcc32 sun CVS .svn ] + ; + skip-headers += [ sequence.transform path.relative-to [ path.make $(header-root) ] : $(lib-headers) ] ; + package.install install-$(lib)-headers + : $(header-root) + $(install-requirements) + on + : # binaries + : # libraries + : $(lib-headers) + ; + $(p).mark-target-as-explicit install-$(lib)-headers ; + } + + # Filter out headers that were created by b2 headers + local header-root = [ path.make $(BOOST_ROOT)/boost ] ; + headers = [ set.difference $(headers) : $(header-root)/$(skip-headers) ] ; + # Complete install. package.install install-proper - : $(install-requirements) on + : $(BOOST_ROOT)/boost + $(install-requirements) + on + : : $(libraries)-for-install : $(headers) @@ -476,17 +508,17 @@ class top-level-target : alias-target-class } } -rule declare_top_level_targets ( libraries * : headers * ) +rule declare_top_level_targets ( libraries * : headers * : modular-headers * ) { - declare_install_and_stage_proper_targets $(libraries) : $(headers) ; + declare_install_and_stage_proper_targets $(libraries) : $(headers) : $(modular-headers) ; targets.create-metatarget top-level-target : [ project.current ] : install - : install-proper install-unversioned + : install-$(modular-headers)-headers install-proper install-unversioned ; targets.create-metatarget top-level-target : [ project.current ] : stage - : stage-proper stage-unversioned + : stage-proper stage-unversioned headers ; p = [ project.current ] ; @@ -611,7 +643,7 @@ rule libraries-to-install ( existing-libs * ) } } -rule declare-targets ( all-libraries * : headers * ) +rule declare-targets ( all-libraries * : headers * : modular-headers * ) { configure.register-components $(all-libraries) ; @@ -629,7 +661,7 @@ rule declare-targets ( all-libraries * : headers * ) EXIT ; } - declare_top_level_targets $(libraries) : $(headers) ; + declare_top_level_targets $(libraries) : $(headers) : $(modular-headers) ; } # Returns the properties identifying the toolset. We'll use them -- cgit v1.2.1