This commit is contained in:
Dane Springmeyer 2013-05-22 09:21:56 -07:00
parent 95d5b73d86
commit 23878cf03e
2 changed files with 41 additions and 41 deletions

View file

@ -1867,11 +1867,10 @@ if not HELP_REQUESTED:
SConscript('fonts/build.py') SConscript('fonts/build.py')
# build C++ tests # build C++ tests
if env['CPP_TESTS']: SConscript('tests/cpp_tests/build.py')
SConscript('tests/cpp_tests/build.py')
if env['SVG_RENDERER']: if env['CPP_TESTS'] and env['SVG_RENDERER']:
SConscript('tests/cpp_tests/svg_renderer_tests/build.py') SConscript('tests/cpp_tests/svg_renderer_tests/build.py')
if env['BENCHMARK']: if env['BENCHMARK']:
SConscript('benchmark/build.py') SConscript('benchmark/build.py')

View file

@ -6,40 +6,41 @@ Import ('env')
test_env = env.Clone() test_env = env.Clone()
test_env['LIBS'] = copy(env['LIBMAPNIK_LIBS']) if not env['CPP_TESTS']:
test_env.AppendUnique(LIBS='mapnik') for cpp_test_bin in glob.glob('*-bin'):
test_env.AppendUnique(LIBS='sqlite3') os.unlink(cpp_test_bin)
test_env.AppendUnique(CXXFLAGS='-g') else:
test_env['LIBS'] = copy(env['LIBMAPNIK_LIBS'])
test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS']) test_env.AppendUnique(LIBS='mapnik')
test_env.AppendUnique(LIBS='sqlite3')
if test_env['HAS_CAIRO']: test_env.AppendUnique(CXXFLAGS='-g')
test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS']) test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS'])
test_env.Append(CPPDEFINES = '-DHAVE_CAIRO') if test_env['HAS_CAIRO']:
test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS'])
for cpp_test in glob.glob('*_test.cpp'): test_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
name = cpp_test.replace('.cpp','-bin') for cpp_test in glob.glob('*_test.cpp'):
source_files = [cpp_test] name = cpp_test.replace('.cpp','-bin')
test_program = None source_files = [cpp_test]
# enable for faster compile while developing just this test test_program = None
#if 'agg_blend_src_over_test' in cpp_test: # enable for faster compile while developing just this test
if False: #if 'agg_blend_src_over_test' in cpp_test:
# customization here for faster compile if False:
agg_env = Environment(ENV=os.environ) # customization here for faster compile
agg_env['CXX'] = env['CXX'] agg_env = Environment(ENV=os.environ)
agg_env['CXXFLAGS'] = env['CXXFLAGS'] agg_env['CXX'] = env['CXX']
if 'agg' in test_env['LIBS']: agg_env['CXXFLAGS'] = env['CXXFLAGS']
agg_env.AppendUnique(LIBS='agg') if 'agg' in test_env['LIBS']:
agg_env.Append(CPPPATH = '#deps/agg/include') agg_env.AppendUnique(LIBS='agg')
agg_env.Append(LIBPATH = '#deps/agg') agg_env.Append(CPPPATH = '#deps/agg/include')
agg_env['CPPPATH'] = ['#deps/agg/include',env['BOOST_INCLUDES']] agg_env.Append(LIBPATH = '#deps/agg')
test_program = agg_env.Program(name, source=source_files, LINKFLAGS=env['CUSTOM_LDFLAGS']) agg_env['CPPPATH'] = ['#deps/agg/include',env['BOOST_INCLUDES']]
else: test_program = agg_env.Program(name, source=source_files, LINKFLAGS=env['CUSTOM_LDFLAGS'])
test_env_local = test_env.Clone() else:
if 'csv_parse' in cpp_test: test_env_local = test_env.Clone()
source_files += glob.glob('../../plugins/input/csv/' + '*.cpp') if 'csv_parse' in cpp_test:
test_program = test_env_local.Program(name, source=source_files, LINKFLAGS=env['CUSTOM_LDFLAGS']) source_files += glob.glob('../../plugins/input/csv/' + '*.cpp')
Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) test_program = test_env_local.Program(name, source=source_files, LINKFLAGS=env['CUSTOM_LDFLAGS'])
# build locally if installing Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
if 'install' in COMMAND_LINE_TARGETS: # build locally if installing
env.Alias('install',test_program) if 'install' in COMMAND_LINE_TARGETS:
env.Alias('install',test_program)