Debian Codegraph @

clunk/SConstruct

raw
1 import os, sys
2
3 env = Environment()
4 debug = False
5
6 sdl_cflags = env.ParseFlags('!pkg-config --cflags sdl')
7 sdl_libs = env.ParseFlags('!pkg-config --libs sdl')
8
9 env.MergeFlags(sdl_cflags)
10 env.MergeFlags(sdl_libs)
11
12 lib_dir = '.'
13 have_sse = False
14 #have_sse = True
15 #debug = True
16 debug = False
17 prefix = ''
18
19 Export('sdl_cflags')
20 Export('sdl_libs')
21 Export('lib_dir')
22 Export('have_sse')
23 Export('env')
24 Export('debug')
25 env['prefix'] = ''
26
27 env.Append(LIBPATH=['.'])
28 env.Append(CPPDEFINES=['DEBUG', '_REENTRANT'])
29 if have_sse:
30 env.Append(CPPDEFINES=['USE_SIMD'])
31
32 if debug:
33 buildmode = 'debug'
34 env.Append(CXXFLAGS=['-ggdb'])
35 else:
36 buildmode = 'release'
37 env.Append(CXXFLAGS=['-O3', '-mtune=native', '-march=native'])
38
39 clunk_src = [
40 'context.cpp', 'sample.cpp', 'object.cpp', 'source.cpp', 'sdl_ex.cpp', 'stream.cpp',
41 'kemar.c', 'buffer.cpp', 'distance_model.cpp', 'logger.cpp', 'clunk_ex.cpp',
42 ]
43 if have_sse:
44 clunk_src.append('sse_fft_context.cpp')
45
46 clunk = env.SharedLibrary('clunk',
47 clunk_src,
48 LIBS=['SDL'])
49
50
51 if sys.platform != 'win32':
52 env.Append(CFLAGS=['-Wall', '-pedantic'])
53 env.Append(CXXFLAGS=['-Wall', '-pedantic'])
54 env.Append(LINKFLAGS=['-Wl,-rpath,'+ lib_dir])
55 env.Append(LINKFLAGS=['-Wl,-rpath-link,.'])
56
57 env.Program('clunk_test', ['test.cpp'], LIBS=['clunk'])