summaryrefslogtreecommitdiff
path: root/slice.jam
blob: 0ea52baf0b4ca38efdf5df8653639f47fda96872 (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
import type : register ;
import generators : register-standard ;
import type ;
import feature : feature ;
import scanner ;
import toolset ;

type.register SLICE : ice ;

feature slicer : no yes pure ;
feature allow-ice : no yes ;
feature ice-visibility : public hidden ;

class slice-scanner : common-scanner
{
    rule pattern ( )
    {
        return "^[ \t]*#[ \t]*include[ ]*[<\"]([^>\"]*)[>\"]" ;
    }
}

scanner.register slice-scanner : include ;

type.set-scanner SLICE : slice-scanner ;

generators.register-standard slice.slice2cpp : SLICE : CPP H : <slicer>no ;
generators.register-standard slice.slicer : SLICE : CPP H : <slicer>yes ;
generators.register-standard slice.slicer.pure : SLICE : CPP : <slicer>pure ;

toolset.flags slice.slice2cpp INCLUDES <include> ;
toolset.flags slice.slice2cpp DLLEXPORT <ice-visibility>public : --dll-export JAM_DLL_PUBLIC ;
toolset.flags slice.slice2cpp ALLOWICE <allow-ice>yes : --ice ;
toolset.flags slice.slicer INCLUDES <include> ;
toolset.flags slice.slicer DLLEXPORT <ice-visibility>public : --dll-export JAM_DLL_PUBLIC ;
toolset.flags slice.slicer ALLOWICE <allow-ice>yes : --ice ;
toolset.flags slice.slicer.pure INCLUDES <include> ;
toolset.flags slice.slicer.pure ALLOWICE <allow-ice>yes : --ice ;

actions slice.slice2cpp
{
  slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) $(ALLOWICE[1])
}

actions slice.slicer
{
  slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) $(ALLOWICE[1])
	slicer -I"$(INCLUDES)" $(2) $(1[1]) $(ALLOWICE[1])
}

actions slice.slicer.pure
{
	truncate -c -s 0 $(1[1])
	slicer -I"$(INCLUDES)" $(2) $(1[1]) $(ALLOWICE[1])
}

IMPORT $(__name__) : slice.slice2cpp : : slice.slice2cpp ;
IMPORT $(__name__) : slice.slicer : : slice.slicer ;
IMPORT $(__name__) : slice.slicer.pure : : slice.slicer.pure ;