source: trunk/SConstruct @ 71

Last change on this file since 71 was 71, checked in by andy, 6 years ago

Added option to turn optimization on and off

  • Property svn:mime-type set to text/x-python
File size: 1.3 KB
Line 
1# scons build file
2
3env = Environment()
4env.MergeFlags(['-Wall -lm -std=c99 -lexpat'])
5
6if ARGUMENTS.get('optimize') in ('y', 'yes'):
7    env.Append(CCFLAGS = ['-O2', '-fomit-frame-pointer'])
8else:
9    env.Append(CCFLAGS = ['-g'])
10
11if ARGUMENTS.get('profile') in ('y', 'yes'):
12    env.Append(CCFLAGS = ['-pg'])
13    env.Append(LINKFLAGS = ['-pg'])
14
15env.ParseConfig('pkg-config --cflags --libs cairo')
16env.ParseConfig('pkg-config --cflags --libs glib-2.0')
17
18conf = Configure(env)
19
20if not conf.CheckLibWithHeader('expat','expat.h','C'):
21    print 'Did not find expat, exiting!'
22    Exit(1)
23
24if not conf.CheckLibWithHeader('cairo','cairo.h','C'):
25    print 'Did not find cairo, exiting!'
26    Exit(1)
27
28if not conf.CheckLibWithHeader('glib-2.0','glib.h','C'):
29    print 'Did not find cairo, exiting!'
30    Exit(1)
31
32env = conf.Finish()
33
34SOURCES = [
35    'libmercator.c',
36    'main.c',
37    'osm05.c',
38    'renderer.c',
39    'ruleset.c',
40    'textpath.c',
41    'mlib.c'
42]
43
44Default(env.Program('memphis', source = SOURCES))
45
46env.Program('testTextPath', source=['test/testTextPath.c','textpath.c'])
47env.Program('testSize', source=['test/testSize.c'])
48env.Program('testOSM', source=['test/testOSM.c','osm05.c','mlib.c'])
49env.Program('testRuleset', source=['test/testRuleset.c','ruleset.c','mlib.c'])
50
51#env.Program('testRuleset', source=['ruleset.c','testRuleset.c'])
Note: See TracBrowser for help on using the repository browser.