summaryrefslogtreecommitdiff
path: root/SConstruct
blob: c2755c5ecf2267b78ad8cd8a5aa997a4a49d5ba4 (plain)
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
AddOption('--release', action = 'store_true')

env = Environment(CPPPATH = ['.'], CCFLAGS = ['-pthread'], LINKFLAGS = ['-pthread'])

if env['PLATFORM'] == 'darwin':
	env.Append(LIBS = ['boost_system', 'boost_filesystem', 'boost_regex', 'boost_thread', 'boost_program_options', 'mp3lame'])
else:
	conf = Configure(env)
	conf.CheckLib('boost_system-mt')
	conf.CheckLib('boost_filesystem-mt')
	conf.CheckLib('boost_regex-mt')
	conf.CheckLib('boost_thread-mt')
	conf.CheckLib('boost_program_options-mt')
	conf.CheckLib('mp3lame')
	conf.CheckLib('soci_core')
	env = conf.Finish()
	# scons' CheckLib doesn't seem to find soci_core
	env.Append(LIBS = ['soci_core'])

if GetOption('release'):
	env.Append(CCFLAGS = ['-O2'])
else:
	env.Append(CCFLAGS = ['-Wall', '-g'])

env.ParseConfig('pkg-config --cflags --libs libmpg123')
env.ParseConfig('pkg-config --cflags --libs id3tag')

env.Program('audistd', Glob('*.cpp') + Glob('decoders/*.cpp') + Glob('encoders/*.cpp'))

# vim: syn=python