Ticket #217: Jamroot

File Jamroot, 865 bytes (added by r.johan.nilsson@…, 16 years ago)

Sample Jamroot for issue (referenced in ticket)

Line 
1import errors feature regex property-set ;
2
3project condtest
4 : default-build debug
5 ;
6
7local argv = [ modules.peek : ARGV ] ;
8
9local incidental-opt ;
10
11if --no-incidental in $(argv)
12{
13 echo CONFIG: Not using incidental in feature definition ;
14}
15else
16{
17 echo CONFIG: Using incidental in feature definition ;
18 incidental-opt = incidental ;
19}
20
21local path-opt = [ regex.transform $(argv) : "^--path=([^ ]+)" ] ;
22if "" = "$(path-opt)"
23{
24 path-opt = sub/dir ;
25}
26
27echo CONFIG: Using path: $(path-opt) ;
28
29feature.feature bar-path : : $(incidental-opt) free path ;
30
31rule bar ( properties * )
32{
33 local ps = [ property-set.create $(properties) ] ;
34
35 if ! [ $(ps).get <bar-path> ]
36 {
37 errors.error "ERROR: bar-path is REALLY needed!!!" ;
38 }
39}
40
41lib foo
42 : # sources
43 : # requirements
44 <bar-path>$(path-opt)
45 <conditional>@bar
46 ;