File: build.py

package info (click to toggle)
mapnik 2.2.0%2Bds1-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,288 kB
  • ctags: 18,382
  • sloc: cpp: 115,128; python: 9,298; xml: 5,692; ansic: 3,726; makefile: 160; sh: 159; lisp: 13
file content (45 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
import glob
from copy import copy

Import ('env')

test_env = env.Clone()

if not env['CPP_TESTS']:
    for cpp_test_bin in glob.glob('*-bin'):
        os.unlink(cpp_test_bin)
else:
    test_env['LIBS'] = copy(env['LIBMAPNIK_LIBS'])
    test_env.AppendUnique(LIBS='mapnik')
    test_env.AppendUnique(CXXFLAGS='-g')
    test_env['CXXFLAGS'] = copy(test_env['LIBMAPNIK_CXXFLAGS'])
    if test_env['HAS_CAIRO']:
        test_env.PrependUnique(CPPPATH=test_env['CAIRO_CPPPATHS'])
        test_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
    for cpp_test in glob.glob('*_test.cpp'):
        name = cpp_test.replace('.cpp','-bin')
        source_files = [cpp_test]
        test_program = None
        # enable for faster compile while developing just this test
        #if 'agg_blend_src_over_test' in cpp_test:
        if False:
            # customization here for faster compile
            agg_env = Environment(ENV=os.environ)
            agg_env['CXX'] = env['CXX']
            agg_env['CXXFLAGS'] = env['CXXFLAGS']
            if 'agg' in test_env['LIBS']:
                agg_env.AppendUnique(LIBS='agg')
            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']))
        # build locally if installing
        if 'install' in COMMAND_LINE_TARGETS:
            env.Alias('install',test_program)