mapnik/benchmark/build.py

53 lines
1.7 KiB
Python
Raw Normal View History

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')
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')
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')
2014-10-01 06:16:29 +02:00
test_env['LINKFLAGS'] = copy(test_env['LIBMAPNIK_LINKFLAGS'])
if env['PLATFORM'] == 'Darwin':
test_env.Append(LINKFLAGS='-F/ -framework CoreFoundation')
test_env_local = test_env.Clone()
2014-08-14 02:21:22 +02:00
#benchmarks = glob.glob('test*cpp')
benchmarks = [
#"test_array_allocation.cpp",
#"test_png_encoding1.cpp",
#"test_png_encoding2.cpp",
#"test_to_string1.cpp",
#"test_to_string2.cpp",
#"test_to_bool.cpp",
#"test_to_double.cpp",
#"test_to_int.cpp",
#"test_utf_encoding.cpp"
"test_polygon_clipping.cpp",
2014-08-14 02:21:22 +02:00
#"test_polygon_clipping_rendering.cpp",
"test_proj_transform1.cpp",
"test_expression_parse.cpp",
"test_face_ptr_creation.cpp",
"test_font_registration.cpp",
"test_rendering.cpp",
"test_rendering_shared_map.cpp",
# "test_numeric_cast_vs_static_cast.cpp",
2014-08-14 02:21:22 +02:00
]
for cpp_test in benchmarks:
test_program = test_env_local.Program('out/'+cpp_test.replace('.cpp',''), source=[cpp_test])
if 'install' in COMMAND_LINE_TARGETS:
env.Alias('install',test_program)
#Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME']))