forked from makerbot/jsonrpc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConscript
69 lines (53 loc) · 1.63 KB
/
SConscript
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
61
62
63
64
65
66
67
68
69
# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:syntax=python:ts=4:
import os
optCC = 'gcc'
optCXX = 'g++'
optAR = 'ar'
optSTRIP = 'strip'
env = Environment(
ENV=os.environ,
tools=['default', 'mb_install'],
toolpath=['#/../mw-scons-tools', '#/Install/mw-scons-tools'])
debug = ARGUMENTS.get('debug', 0)
target = ARGUMENTS.get('target', 0)
SYSROOT = ARGUMENTS.get('sysroot', 0)
TCPREFIX = ARGUMENTS.get('tcprefix', 0)
TCVERSION = ARGUMENTS.get('tcversion', 0)
if SYSROOT!=0:
sysroot=SYSROOT
if TCPREFIX!=0:
optCC=('%s-' % TCPREFIX) + optCC
optCXX=('%s-' % TCPREFIX) + optCXX
optAR=('%s-' % TCPREFIX) + optAR
optSTRIP=('%s-' % TCPREFIX) + optSTRIP
if TCVERSION!=0:
optCC=optCC + ('-%s' % TCVERSION)
optCXX=optCXX + ('-%s' % TCVERSION)
optAR=optAR + ('-%s' % TCPREFIX)
env_options = {
"CC" : optCC,
"CXX" : optCXX,
"LD" : optCXX,
"AR" : optAR,
"STRIP" : optSTRIP
}
if int(debug):
env.Append(CCFLAGS = '-g')
if target == 'arm':
env.Replace(**env_options)
if SYSROOT!=0:
env.Append(CCFLAGS=['--sysroot=%s' % sysroot],
LINKFLAGS=['--sysroot=%s' % sysroot])
env.Append(CCFLAGS=['-I%s/usr/include/arm-linux-gnueabihf/c++/4.9' % sysroot])
env.Append(CCFLAGS=['-I%s/usr/include/c++/4.9' % sysroot])
env.MBAddStandardCompilerFlags()
env.MBAddIncludePaths([
Dir('src/main/include/'),
Dir('src/main/')])
env.MBDependsOnJsonCpp()
libjsonrpc = env.MBSharedLibrary(
'jsonrpc', [Glob('src/main/cpp/*.cpp')])
env.Clean(libjsonrpc, '#/obj')
env.MBInstallLib(libjsonrpc, 'jsonrpc')
env.MBInstallHeaders(env.MBGlob('#/src/main/include/jsonrpc/*'), 'jsonrpc')
env.MBCreateInstallTarget()