]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/generators/searched-lib-generator.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / generators / searched-lib-generator.jam
1 # Copyright 2002-2017 Rene Rivera
2 # Copyright 2002-2017 Vladimir Prus
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE_1_0.txt or copy at
5 # http://www.boost.org/LICENSE_1_0.txt)
6
7 import "class" : new ;
8 import generators ;
9
10 class searched-lib-generator : generator
11 {
12 import property-set ;
13
14 rule __init__ ( )
15 {
16 # The requirements cause the generators to be tried *only* when we are
17 # building a lib target with a 'search' feature. This seems ugly --- all
18 # we want is to make sure searched-lib-generator is not invoked deep
19 # inside transformation search to produce intermediate targets.
20 generator.__init__ searched-lib-generator : : SEARCHED_LIB ;
21 }
22
23 rule run ( project name ? : property-set : sources * )
24 {
25 if $(name)
26 {
27 # If 'name' is empty, it means we have not been called to build a
28 # top-level target. In this case, we just fail immediately, because
29 # searched-lib-generator cannot be used to produce intermediate
30 # targets.
31
32 local properties = [ $(property-set).raw ] ;
33 local shared ;
34 if <link>shared in $(properties)
35 {
36 shared = true ;
37 }
38
39 local search = [ feature.get-values <search> : $(properties) ] ;
40
41 local a = [ new null-action $(property-set) ] ;
42 local lib-name = [ feature.get-values <name> : $(properties) ] ;
43 lib-name ?= $(name) ;
44 local t = [ new searched-lib-target $(lib-name) : $(project)
45 : $(shared) : $(search) : $(a) ] ;
46 # We return sources for a simple reason. If there is
47 # lib png : z : <name>png ;
48 # the 'z' target should be returned, so that apps linking to 'png'
49 # will link to 'z', too.
50 return [ property-set.create <xdll-path>$(search) ]
51 [ virtual-target.register $(t) ] $(sources) ;
52 }
53 }
54 }
55
56 generators.register [ new searched-lib-generator ] ;
57
58 class searched-lib-target : abstract-file-target
59 {
60 rule __init__ ( name
61 : project
62 : shared ?
63 : search *
64 : action
65 )
66 {
67 abstract-file-target.__init__ $(name) : SEARCHED_LIB : $(project)
68 : $(action) : ;
69
70 self.shared = $(shared) ;
71 self.search = $(search) ;
72 }
73
74 rule shared ( )
75 {
76 return $(self.shared) ;
77 }
78
79 rule search ( )
80 {
81 return $(self.search) ;
82 }
83
84 rule actualize-location ( target )
85 {
86 NOTFILE $(target) ;
87 }
88
89 rule path ( )
90 {
91 }
92 }