]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/example/pkg-config/jamroot.jam
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / tools / build / example / pkg-config / jamroot.jam
1 #|
2 Copyright 2019 Dmitry Arkhipov
3 Distributed under the Boost Software License, Version 1.0. (See
4 accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt)
6 |#
7
8
9 using pkg-config : : : <libdir>packages ;
10 using pkg-config : debug : : <libdir>packages <path>debug-packages ;
11
12 import common ;
13 import pkg-config ;
14 import property-set ;
15 import testing ;
16 import version ;
17
18
19 project : requirements <variant>debug:<pkg-config>debug ;
20
21
22 pkg-config.import debugged ;
23 pkg-config.import foobar : requirements <version>>=0.3 ;
24 pkg-config.import mangled : requirements <conditional>@mangle-name ;
25
26 versioned =
27 [ pkg-config.import versioned
28 : usage-requirements <conditional>@versioned-api
29 ] ;
30
31 with-var =
32 [ pkg-config.import with-var
33 : usage-requirements <conditional>@var-to-define
34 ] ;
35
36
37 # test if a package is found at all
38 run test1.cpp foobar ;
39
40 # test if conditional requirement is applied
41 run test2.cpp mangled
42 : target-name test2-1
43 : requirements <threading>single
44 : args SINGLE
45 ;
46
47 run test2.cpp mangled
48 : target-name test2-2
49 : requirements <threading>multi
50 : args MULTI
51 ;
52
53 # test if pkg-config configuration is properly inferred from property set
54 run test3.cpp debugged
55 : target-name test3-1
56 : requirements <variant>release
57 : args RELEASE
58 ;
59
60 run test3.cpp debugged
61 : target-name test3-2
62 : requirements <variant>debug
63 : args DEBUG
64 ;
65
66 # test use of version method of pkg-config targets
67 run test4.cpp versioned ;
68
69 # test use of variable method of pkg-config targets
70 run test5.cpp with-var ;
71
72
73 rule mangle-name ( props * ) {
74 import feature ;
75 local name =
76 [ common.format-name
77 <base> <threading>
78 : mangled
79 : ""
80 : [ property-set.create $(props) ]
81 ] ;
82 return <name>$(name) ;
83 }
84
85
86 rule versioned-api ( props * ) {
87 local ps = [ property-set.create $(props) ] ;
88 local version = [ $(versioned).version $(ps) ] ;
89 if [ version.version-less $(version) : 2 ]
90 {
91 return <define>VERSIONED_API=1 ;
92 }
93 else
94 {
95 return <define>VERSIONED_API=2 ;
96 }
97 }
98
99
100 rule var-to-define ( props * ) {
101 local ps = [ property-set.create $(props) ] ;
102 local qwerty = [ $(with-var).variable qwerty : $(ps) ] ;
103 return <define>QWERTY=\\\"$(qwerty)\\\" ;
104 }