summaryrefslogtreecommitdiff
path: root/tools/build/v2/test/unused/jamroot.jam
blob: bc97c2b197abc34781137b5344e89b7f02e0803b (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
58
59
60
# 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 ;
import project ;


type.register X : x ;

class test-target-class : basic-target
{
    rule __init__ ( name : project )
    {
        basic-target.__init__ $(name) : $(project) ;
    }
        
    rule construct ( name : source-targets * : property-set )
    {
        if [ modules.peek : GENERATE_NOTHING ]
        {
            return [ property-set.empty ] ;
        }
        else if [ modules.peek : GENERATE_ONLY_UNUSABLE ] 
        {
            return [ property-set.empty ]
              [ virtual-target.from-file b.x : . : $(self.project) ] 
              ;             
        }
        else
        {            
            return [ property-set.empty ]
              [ 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 = [ project.current ] ;    
    
    targets.main-target-alternative 
      [ new test-target-class b : $(project) ] ;
}

IMPORT $(__name__) : make-b-main-target : : make-b-main-target ;