From dab246947a577873187e76ab0b5a6c5b8b1c2921 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 28 Nov 2006 09:53:44 +0000 Subject: [PATCH] Initial commit. [SVN r36194] --- test/link/test/Jamfile.v2 | 94 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 test/link/test/Jamfile.v2 diff --git a/test/link/test/Jamfile.v2 b/test/link/test/Jamfile.v2 new file mode 100644 index 00000000..272c0d7a --- /dev/null +++ b/test/link/test/Jamfile.v2 @@ -0,0 +1,94 @@ + +import type ; + +type.register AUTOLINK_LIB ; + +import generators ; +import "class" : new ; + +# This generator creates library using standard generators, +# and then add usage requirements with the +# path of the created library. +class autolink-generator : generator +{ + import generators ; + import "class" ; + import property-set ; + import path ; + + rule run ( project name ? : property-set : sources + ) + { + local result = [ generators.construct $(project) $(name) + : LIB : $(property-set) : $(sources) ] ; + + local targets ; + local usage-requirements ; + + if [ class.is-a $(result[1]) : property-set ] + { + usage-requirements = $(result[1]) ; + targets = $(result[2-]) ; + } + else + { + usage-requirements = [ property-set.empty ] ; + targets = $(result) ; + } + + local extra ; + local paths ; + local pwd = [ path.pwd ] ; + for local t in $(targets) + { + if [ type.is-derived [ $(t).type ] LIB ] + { + paths += [ path.root [ path.make [ $(t).path ] ] $(pwd) ] ; + } + } + extra += $(paths:G=) ; + if $(extra) + { + extra = [ sequence.unique $(extra) ] ; + usage-requirements = [ $(usage-requirements).add-raw $(extra) ] ; + } + return $(usage-requirements) $(targets) ; + } +} + +generators.register [ + new autolink-generator $(__name__).autolink : : AUTOLINK_LIB ] ; + +project : requirements -multi false ; + +autolink-lib link_test : ../link_test.cpp + : shared:BOOST_DYN_LINK=1 + : + ; + +explicit link_test ; + +run ../main.cpp link_test + : : : static static single debug : link_test_static_single_debug ; + +run ../main.cpp link_test + : : : static static single release : link_test_static_single_release ; + +run ../main.cpp link_test + : : : static static multi debug : link_test_static_multi_debug ; + +run ../main.cpp link_test + : : : static static multi release : link_test_static_multi_release ; + +run ../main.cpp link_test + : : : static shared multi debug : link_test_dyn_multi_debug ; + +run ../main.cpp link_test + : : : static shared multi release : link_test_dyn_multi_release ; + +run ../main.cpp link_test + : : : BOOST_DYN_LINK=1 shared shared multi debug : link_test_dll_dyn_multi_debug ; + +run ../main.cpp link_test + : : : BOOST_DYN_LINK=1 shared shared multi release : link_test_dll_dyn_multi_release ; + +