2010-07-15 23:09:33 +00:00
|
|
|
import os
|
|
|
|
import glob
|
2011-08-12 21:31:28 +00:00
|
|
|
from copy import copy
|
2010-07-15 23:09:33 +00:00
|
|
|
|
|
|
|
Import ('env')
|
|
|
|
|
2011-08-12 21:31:28 +00:00
|
|
|
test_env = env.Clone()
|
|
|
|
|
2010-07-15 23:09:33 +00:00
|
|
|
headers = env['CPPPATH']
|
|
|
|
|
2012-07-21 01:33:14 +00:00
|
|
|
libraries = copy(env['LIBMAPNIK_LIBS'])
|
2011-11-23 11:33:58 +00:00
|
|
|
libraries.append('mapnik')
|
2012-07-21 01:33:14 +00:00
|
|
|
libraries.append('sqlite3')
|
2010-07-15 23:09:33 +00:00
|
|
|
|
2012-03-23 22:07:28 +00:00
|
|
|
test_env.Append(CXXFLAGS='-g')
|
|
|
|
|
2010-07-15 23:09:33 +00:00
|
|
|
for cpp_test in glob.glob('*_test.cpp'):
|
2012-04-04 22:19:37 +00:00
|
|
|
test_program = test_env.Program(cpp_test.replace('.cpp','-bin'), [cpp_test], CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
2011-08-11 21:11:11 +00:00
|
|
|
Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
2012-04-04 22:19:37 +00:00
|
|
|
# build locally if installing
|
|
|
|
if 'install' in COMMAND_LINE_TARGETS:
|
|
|
|
env.Alias('install',test_program)
|