-
Notifications
You must be signed in to change notification settings - Fork 10
/
SConstruct
58 lines (46 loc) · 1.32 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
import os, sys
env = Environment()
debug = False
sdl_cflags = env.ParseFlags('!pkg-config --cflags sdl')
sdl_libs = env.ParseFlags('!pkg-config --libs sdl')
env.MergeFlags(sdl_cflags)
env.MergeFlags(sdl_libs)
lib_dir = '.'
have_sse = False
#have_sse = True
#debug = True
debug = False
prefix = ''
Export('sdl_cflags')
Export('sdl_libs')
Export('lib_dir')
Export('have_sse')
Export('env')
Export('debug')
env['prefix'] = ''
env.Append(LIBPATH=['.'])
env.Append(CPPDEFINES=['DEBUG', '_REENTRANT'])
if have_sse:
env.Append(CPPDEFINES=['CLUNK_USES_SSE'])
if debug:
buildmode = 'debug'
env.Append(CXXFLAGS=['-ggdb'])
else:
buildmode = 'release'
env.Append(CXXFLAGS=['-O3', '-mtune=native', '-march=native'])
clunk_src = [
'context.cpp', 'sample.cpp', 'object.cpp', 'source.cpp', 'sdl_ex.cpp', 'stream.cpp',
'kemar.c', 'buffer.cpp', 'distance_model.cpp', 'logger.cpp', 'clunk_ex.cpp', 'clunk_c.cpp'
]
if have_sse:
clunk_src.append('sse_fft_context.cpp')
clunk = env.SharedLibrary('clunk',
clunk_src,
LIBS=['SDL'])
if sys.platform != 'win32':
env.Append(CFLAGS=['-Wall', '-pedantic'])
env.Append(CXXFLAGS=['-Wall', '-pedantic'])
env.Append(LINKFLAGS=['-Wl,-rpath,'+ lib_dir])
env.Append(LINKFLAGS=['-Wl,-rpath-link,.'])
env.Program('clunk_test', ['test.cpp'], LIBS=['clunk'])
env.Program('clunk_c_test', ['test_c.c'], LIBS=['clunk'])