2013-01-09 04:07:11 +01:00
|
|
|
import os
|
|
|
|
import glob
|
|
|
|
from copy import copy
|
|
|
|
|
|
|
|
Import ('env')
|
|
|
|
|
|
|
|
test_env = env.Clone()
|
|
|
|
|
2014-06-10 20:58:58 +02:00
|
|
|
test_env['LIBS'] = [env['MAPNIK_NAME']]
|
|
|
|
test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS']))
|
2015-02-12 08:47:26 +01:00
|
|
|
test_env.AppendUnique(LIBS='mapnik-wkt')
|
2021-01-21 13:47:41 +01:00
|
|
|
test_env.AppendUnique(LIBS='sqlite3')
|
2014-07-23 00:36:45 +02:00
|
|
|
if env['PLATFORM'] == 'Linux':
|
2014-06-10 20:58:58 +02:00
|
|
|
test_env.AppendUnique(LIBS='dl')
|
2014-06-10 21:01:35 +02:00
|
|
|
test_env.AppendUnique(LIBS='rt')
|
2013-01-09 04:07:11 +01:00
|
|
|
test_env.AppendUnique(CXXFLAGS='-g')
|
2014-06-10 20:58:58 +02:00
|
|
|
test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS'])
|
|
|
|
test_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
|
|
|
if test_env['HAS_CAIRO']:
|
|
|
|
test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS'])
|
|
|
|
test_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
2016-03-01 16:50:29 +01:00
|
|
|
test_env.PrependUnique(CPPPATH='include', delete_existing=True)
|
2014-10-01 06:16:29 +02:00
|
|
|
test_env['LINKFLAGS'] = copy(test_env['LIBMAPNIK_LINKFLAGS'])
|
2013-02-27 23:48:51 +01:00
|
|
|
if env['PLATFORM'] == 'Darwin':
|
2013-10-22 22:35:46 +02:00
|
|
|
test_env.Append(LINKFLAGS='-F/ -framework CoreFoundation')
|
2013-01-09 04:07:11 +01:00
|
|
|
|
2013-11-15 08:11:21 +01:00
|
|
|
test_env_local = test_env.Clone()
|
|
|
|
|
2018-07-11 15:43:22 +02:00
|
|
|
benchmarks = glob.glob("src/*.cpp")
|
|
|
|
|
|
|
|
for src in benchmarks:
|
|
|
|
name, ext = os.path.splitext(os.path.basename(src))
|
|
|
|
out = os.path.join("out", name)
|
|
|
|
test_program = test_env_local.Program(out, source=[src])
|
2013-01-09 04:07:11 +01:00
|
|
|
if 'install' in COMMAND_LINE_TARGETS:
|
|
|
|
env.Alias('install',test_program)
|
2013-11-15 08:11:21 +01:00
|
|
|
#Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME']))
|