blob: 75832afd20e4c600219bb34bc8fc10e0f1355571 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import type ;
import generators ;
import print ;
import virtual-target ;
import "class" : new ;
import modules ;
import targets ;
type.register X : x ;
class test-target-class : basic-target
{
rule __init__ ( name : project )
{
basic-target.__init__ $(name) : $(project) ;
}
rule construct ( source-targets * : property-set )
{
if [ modules.peek : GENERATE_NOTHING ]
{
return ;
}
else if [ modules.peek : GENERATE_ONLY_UNUSABLE ]
{
return [ virtual-target.from-file b.x : $(self.project) ]
;
}
else
{
return [ virtual-target.from-file b.x : $(self.project) ]
[ virtual-target.from-file b.cpp : $(self.project) ]
;
}
}
rule compute-usage-requirements ( rproperties : targets * )
{
return [ property-set.create <define>FOO ] ;
}
}
rule make-b-main-target
{
local project = [ CALLER_MODULE ] ;
targets.main-target-alternative
[ new test-target-class b : $(project) ] ;
}
IMPORT $(__name__) : make-b-main-target : : make-b-main-target ;
|