| 1 | import errors feature regex property-set ;
|
|---|
| 2 |
|
|---|
| 3 | project condtest
|
|---|
| 4 | : default-build debug
|
|---|
| 5 | ;
|
|---|
| 6 |
|
|---|
| 7 | local argv = [ modules.peek : ARGV ] ;
|
|---|
| 8 |
|
|---|
| 9 | local incidental-opt ;
|
|---|
| 10 |
|
|---|
| 11 | if --no-incidental in $(argv)
|
|---|
| 12 | {
|
|---|
| 13 | echo CONFIG: Not using incidental in feature definition ;
|
|---|
| 14 | }
|
|---|
| 15 | else
|
|---|
| 16 | {
|
|---|
| 17 | echo CONFIG: Using incidental in feature definition ;
|
|---|
| 18 | incidental-opt = incidental ;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | local path-opt = [ regex.transform $(argv) : "^--path=([^ ]+)" ] ;
|
|---|
| 22 | if "" = "$(path-opt)"
|
|---|
| 23 | {
|
|---|
| 24 | path-opt = sub/dir ;
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | echo CONFIG: Using path: $(path-opt) ;
|
|---|
| 28 |
|
|---|
| 29 | feature.feature bar-path : : $(incidental-opt) free path ;
|
|---|
| 30 |
|
|---|
| 31 | rule 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 |
|
|---|
| 41 | lib foo
|
|---|
| 42 | : # sources
|
|---|
| 43 | : # requirements
|
|---|
| 44 | <bar-path>$(path-opt)
|
|---|
| 45 | <conditional>@bar
|
|---|
| 46 | ;
|
|---|