-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSConscript
75 lines (56 loc) · 1.98 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
70
71
72
73
74
75
from building import *
CWD = GetCurrentDir()
sys.path.append(CWD)
import Sg
objs = Glob('src/*.c')
@register_library
class LibrarySg(Library):
def useSDL(self):
self.LIBS = ['SDL2']
self.CPPDEFINES = ['USE_SDL']
def useGTK(self):
self.CPPDEFINES = ['USE_GTK']
pkgcfg = 'pkg-config'
if IsPlatformWindows():
pkgcfg = '%s/mingw64/bin/pkg-config' % (os.getenv('MSYS2'))
self.ParseConfig('%s --cflags gtk+-3.0' % (pkgcfg))
self.ParseConfig('%s --libs gtk+-3.0 glib-2.0 gthread-2.0' % (pkgcfg))
def config(self):
self.include = '%s/include' % (CWD)
self.CPPPATH = ['$INFRAS']
# self.useSDL()
self.useGTK()
self.source = objs
sml = '%s/examples/cluster/Sg.xml' % (CWD)
Sg.GenerateSg(sml)
objsIC = Glob('examples/cluster/src/*.c') + Glob('examples/cluster/SgRes/*.c')
@register_library
class LibraryCluster(Library):
def config(self):
self.LIBS = ['Sg', 'Plugin']
self.CPPPATH = ['$INFRAS', '$Com_Cfg']
self.Append(CPPPATH=['%s/examples/cluster/SgRes' % (CWD)])
self.source = objsIC
ApplicationCanApp = query_application('CanApp')
@register_application
class ApplicationCluster(ApplicationCanApp):
def config(self):
super().config()
self.LIBS += ['Cluster']
self.Append(CPPDEFINES=['USE_SG'])
sml = '%s/examples/watch/Sg.xml' % (CWD)
Sg.GenerateSg(sml)
objsWatch = Glob('examples/watch/src/*.c') + Glob('examples/watch/SgRes/*.c')
@register_library
class LibraryWatch(Library):
def config(self):
self.LIBS = ['Sg', 'Plugin']
self.CPPPATH = ['$INFRAS']
self.Append(CPPPATH=['%s/examples/watch/SgRes' % (CWD)])
self.source = objsWatch
@register_application
class ApplicationWatch(ApplicationCanApp):
def config(self):
super().config()
self.LIBS += ['Watch']
self.Append(CPPDEFINES=['USE_SG'])