1 # copyright John Maddock 2006
2 # Use, modification and distribution are subject to the
3 # Boost Software License, Version 1.0. (See accompanying file
4 # LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 type.register AUTOLINK_LIB ;
11 import "class" : new ;
13 # This generator creates library using standard generators,
14 # and then add <library-path> usage requirements with the
15 # path of the created library.
16 class autolink-generator : generator
23 rule run ( project name ? : property-set : sources + )
25 local result = [ generators.construct $(project) $(name)
26 : LIB : $(property-set) : $(sources) ] ;
29 local usage-requirements ;
31 if [ class.is-a $(result[1]) : property-set ]
33 usage-requirements = $(result[1]) ;
34 targets = $(result[2-]) ;
38 usage-requirements = [ property-set.empty ] ;
44 local pwd = [ path.pwd ] ;
45 for local t in $(targets)
47 if [ type.is-derived [ $(t).type ] LIB ]
49 paths += [ path.root [ path.make [ $(t).path ] ] $(pwd) ] ;
52 extra += $(paths:G=<library-path>) ;
55 extra = [ sequence.unique $(extra) ] ;
56 usage-requirements = [ $(usage-requirements).add-raw $(extra) ] ;
58 return $(usage-requirements) $(targets) ;
63 new autolink-generator $(__name__).autolink : : AUTOLINK_LIB ] ;
65 project : requirements -<threading>multi <hardcode-dll-paths>false ;
67 autolink-lib link_test : ../link_test.cpp
68 : <link>shared:<define>BOOST_DYN_LINK=1
75 run ../main.cpp link_test
76 : : : <toolset>msvc-8.0:<build>no <toolset>msvc-9.0:<build>no <toolset>msvc-10.0:<build>no <toolset>msvc-11.0:<build>no <toolset>msvc-12.0:<build>no <link>static <runtime-link>static <threading>single debug : link_test_ssd ;
78 run ../main.cpp link_test
79 : : : <toolset>msvc-8.0:<build>no <toolset>msvc-9.0:<build>no <toolset>msvc-10.0:<build>no <toolset>msvc-11.0:<build>no <toolset>msvc-12.0:<build>no <link>static <runtime-link>static <threading>single release : link_test_ssr ;
81 run ../main.cpp link_test
82 : : : <link>static <runtime-link>static <threading>multi debug : link_test_smd ;
84 run ../main.cpp link_test
85 : : : <link>static <runtime-link>static <threading>multi release : link_test_smr ;
87 run ../main.cpp link_test
88 : : : <link>static <runtime-link>shared <threading>multi debug : link_test_dmd ;
90 run ../main.cpp link_test
91 : : : <link>static <runtime-link>shared <threading>multi release : link_test_dmr ;
93 run ../main.cpp link_test
94 : : : <link>static <runtime-link>shared <threading>single debug : link_test_dsd ;
96 run ../main.cpp link_test
97 : : : <link>static <runtime-link>shared <threading>single release : link_test_dsr ;
99 run ../main.cpp link_test
100 : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>multi debug : link_test_dll_dmd ;
102 run ../main.cpp link_test
103 : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>multi release : link_test_dll_dmr ;
105 run ../main.cpp link_test
106 : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>single debug : link_test_dll_dsd ;
108 run ../main.cpp link_test
109 : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>single release : link_test_dll_dsr ;