-
Notifications
You must be signed in to change notification settings - Fork 0
/
builders.py
29 lines (24 loc) · 858 Bytes
/
builders.py
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
import SCons.Scanner.IDL
from SCons.Script import *
def idl2many_emitter(target, source, env):
newTarget = []
src = source[0]
dst = target[0]
if str(src).endswith('.ice'):
for suffix in ['.cc', '.h']:
newTarget.append(str(dst) + suffix)
return (newTarget, source)
def addSlice2cppBuilder(env):
env['BUILDERS']['Slice2cpp'] = Builder(
action="${SLICE2CPP} --source-ext=cc -I${SLICE_INCLUDES} -I. ${SLICEFLAGS} --output-dir ${TARGET.dir} ${SOURCE}",
src_suffix = '.ice',
emitter = idl2many_emitter,
source_scanner = SCons.Scanner.IDL.IDLScan(),
single_source = 1
)
def MyInstallBld(env, target, source):
if 'DO_PACKAGE' in env:
return env.Install(target, source)
return []
def addMyInstallBuilder(env):
env['BUILDERS']['MyInstall'] = MyInstallBld