forked from LumaPictures/arnold-rv
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SConstruct
69 lines (53 loc) · 1.59 KB
/
SConstruct
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
import os
import sys
import glob
import subprocess
initsubs = False
try:
import excons
if len(glob.glob("gcore/*")) == 0:
initsubs = True
if len(glob.glob("gnet/*")) == 0:
initsubs = True
except:
initsubs = True
if initsubs:
subprocess.Popen("git submodule init", shell=True).communicate()
subprocess.Popen("git submodule update", shell=True).communicate()
import excons
import excons.tools.arnold as arnold
import excons.tools.threads as threads
import excons.tools.boost as boost
env = excons.MakeBaseEnv()
static = (excons.GetArgument("static", 1, int) != 0)
# to force static build (or not) in gnet
excons.SetArgument("static", 1 if static else 0)
SConscript("gcore/SConstruct")
excons.SetArgument("with-gcore-inc", os.path.abspath("gcore/include"))
SConscript("gnet/SConstruct")
customs = [arnold.Require]
if static:
customs.append(threads.Require)
if sys.platform != "win32":
def NoUnused(env):
env.Append(CPPFLAGS=" -Wno-unused-parameter")
customs.append(NoUnused)
targets = [
{"name": "rvdriver",
"type": "dynamicmodule",
"ext": arnold.PluginExt(),
"defs": (["GCORE_STATIC", "GNET_STATIC"] if static else []),
"incdirs": ["gcore/include", "gnet/include"],
"srcs": ["driver/rvdriver.cpp"],
"libs": ["gcore", "gnet"],
"custom": customs
},
{"name": "driver_rv",
"type": "dynamicmodule",
"ext": arnold.PluginExt(),
"srcs": ["driver/driver_rv.cpp"],
"custom": [arnold.Require, boost.Require(libs=["thread-mt", "date_time-mt", "system-mt"])]
}
]
excons.DeclareTargets(env, targets)
Default("rvdriver")