2010-07-16 01:09:33 +02:00
|
|
|
import os
|
|
|
|
import glob
|
2011-08-12 23:31:28 +02:00
|
|
|
from copy import copy
|
2010-07-16 01:09:33 +02:00
|
|
|
|
|
|
|
Import ('env')
|
|
|
|
|
2011-08-12 23:31:28 +02:00
|
|
|
test_env = env.Clone()
|
|
|
|
|
2012-08-23 18:10:03 +02:00
|
|
|
test_env['LIBS'] = copy(env['LIBMAPNIK_LIBS'])
|
|
|
|
test_env.AppendUnique(LIBS='mapnik')
|
|
|
|
test_env.AppendUnique(LIBS='sqlite3')
|
|
|
|
test_env.AppendUnique(CXXFLAGS='-g')
|
2012-03-23 23:07:28 +01:00
|
|
|
|
2013-02-26 21:00:04 +01:00
|
|
|
test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS'])
|
|
|
|
|
|
|
|
if test_env['HAS_CAIRO']:
|
|
|
|
test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS'])
|
2013-03-14 03:49:59 +01:00
|
|
|
test_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
2013-02-26 21:00:04 +01:00
|
|
|
|
2010-07-16 01:09:33 +02:00
|
|
|
for cpp_test in glob.glob('*_test.cpp'):
|
2012-08-23 18:10:03 +02:00
|
|
|
name = cpp_test.replace('.cpp','-bin')
|
|
|
|
source_files = [cpp_test]
|
2012-09-01 03:15:56 +02:00
|
|
|
test_program = None
|
|
|
|
if 'agg_blend_src_over_test' in cpp_test:
|
|
|
|
# customization here for faster compile
|
|
|
|
agg_env = Environment(ENV=os.environ)
|
|
|
|
agg_env['CXX'] = env['CXX']
|
|
|
|
agg_env['CXXFLAGS'] = env['CXXFLAGS']
|
2012-10-10 19:23:04 +02:00
|
|
|
if 'agg' in test_env['LIBS']:
|
|
|
|
agg_env.AppendUnique(LIBS='agg')
|
2012-09-01 03:15:56 +02:00
|
|
|
agg_env.Append(CPPPATH = '#deps/agg/include')
|
|
|
|
agg_env.Append(LIBPATH = '#deps/agg')
|
|
|
|
agg_env['CPPPATH'] = ['#deps/agg/include',env['BOOST_INCLUDES']]
|
|
|
|
test_program = agg_env.Program(name, source=source_files, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
|
|
|
else:
|
|
|
|
test_env_local = test_env.Clone()
|
|
|
|
if 'csv_parse' in cpp_test:
|
|
|
|
source_files += glob.glob('../../plugins/input/csv/' + '*.cpp')
|
|
|
|
test_program = test_env_local.Program(name, source=source_files, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
|
|
|
Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
2012-04-05 00:19:37 +02:00
|
|
|
# build locally if installing
|
|
|
|
if 'install' in COMMAND_LINE_TARGETS:
|
|
|
|
env.Alias('install',test_program)
|