251e525667de3ac8c5f7bbe6ae0eab020218160f
[platform/upstream/boost.git] / libs / config / test / link / test / Jamfile.v2
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)
5
6 import type ;
7
8 type.register AUTOLINK_LIB ;
9
10 import generators ;
11 import "class" : new ;
12
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
17 {
18     import generators ;
19     import "class" ;
20     import property-set ;
21     import path ;
22
23     rule run ( project name ? : property-set : sources + )
24     {
25         local result = [ generators.construct $(project) $(name)
26             : LIB : $(property-set) : $(sources) ] ;
27                             
28         local targets ;
29         local usage-requirements ;
30         
31         if [ class.is-a $(result[1]) : property-set ]
32         {
33             usage-requirements = $(result[1]) ;
34             targets = $(result[2-]) ;
35         }
36         else
37         {
38             usage-requirements = [ property-set.empty ] ;
39             targets = $(result) ;
40         }
41         
42         local extra ;
43         local paths ;
44         local pwd = [ path.pwd ] ;
45         for local t in $(targets)
46         {
47             if [ type.is-derived [ $(t).type ] LIB ] 
48             {
49                 paths += [ path.root [ path.make [ $(t).path ] ] $(pwd) ] ;
50             }                                            
51         }
52         extra += $(paths:G=<library-path>) ;
53         if $(extra)
54         {
55             extra = [ sequence.unique $(extra) ] ;
56             usage-requirements = [ $(usage-requirements).add-raw $(extra) ] ;
57         }
58         return $(usage-requirements) $(targets) ;
59     }
60 }
61
62 generators.register [ 
63   new autolink-generator $(__name__).autolink  : : AUTOLINK_LIB ] ;
64
65 project : requirements -<threading>multi <hardcode-dll-paths>false ;
66
67 autolink-lib link_test : ../link_test.cpp 
68     : <link>shared:<define>BOOST_DYN_LINK=1
69     : 
70     ;
71     
72    
73 explicit link_test ;
74
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 ;
77
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 ;
80
81 run ../main.cpp link_test
82   : : : <link>static <runtime-link>static <threading>multi debug : link_test_smd ;
83
84 run ../main.cpp link_test
85   : : : <link>static <runtime-link>static <threading>multi release : link_test_smr ;
86
87 run ../main.cpp link_test
88   : : : <link>static <runtime-link>shared <threading>multi debug : link_test_dmd ;
89
90 run ../main.cpp link_test
91   : : : <link>static <runtime-link>shared <threading>multi release : link_test_dmr ;
92
93 run ../main.cpp link_test
94   : : : <link>static <runtime-link>shared <threading>single debug : link_test_dsd ;
95
96 run ../main.cpp link_test
97   : : : <link>static <runtime-link>shared <threading>single release : link_test_dsr ;
98
99 run ../main.cpp link_test
100   : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>multi debug : link_test_dll_dmd ;
101
102 run ../main.cpp link_test
103   : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>multi release : link_test_dll_dmr ;
104
105 run ../main.cpp link_test
106   : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>single debug : link_test_dll_dsd ;
107
108 run ../main.cpp link_test
109   : : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>single release : link_test_dll_dsr ;
110
111
112
113
114
115
116
117