This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
SConstruct
54 lines (45 loc) · 1.42 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
import os
PLATFORM = os.uname()[0].lower()
libs = ['lua',
'boost_system-mt',
'boost_filesystem-mt',
'boost_program_options-mt']
env = Environment()
if os.name == 'nt':
env = Environment(tools = ['mingw'])
home = os.environ['HOME']
escape = env['ESCAPE']
env['ENV']['PATH'] += ';' + escape(home) + '/bin'
env['ENV']['USERPROFILE'] = home
env.Append(CCFLAGS = '-I' + escape(home) + '/include')
env.Append(LIBPATH = [home + '/lib'])
env.Append(HOME = home)
elif os.name == 'posix':
libs.append('dl')
if PLATFORM == 'darwin':
archs = map(lambda x: ['-arch', x], ['i386', 'x86_64'])
env.Append(
CCFLAGS = archs,
LINKFLAGS = archs
)
debug = ARGUMENTS.get('debug', 1)
if int(debug):
env.Append(CCFLAGS = '-O0 -g')
env.Append(LINKFLAGS = '-g')
sourcefiles = ['Parser.cpp',
'Scanner.cpp',
'keyboard.cc',
'hid_usages.cc',
'lua_helpers.cc',
'keyboard_visitor.cc',
'lua_keyboard_visitor.cc',
'binding.cc',
'utils.cc',
'main.cc']
env.Program(target = 'kspec',
source = sourcefiles,
ENV = {'PATH' : os.environ['PATH']},
LIBS = libs)
env.Command(target = ['Parser.cpp', 'Parser.h', 'Scanner.cpp', 'Scanner.h'],
source = 'kspec.atg',
action = "coco $SOURCE")