From 8e9ff61190b0f182c32e083717fcd0f5dc8e2013 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 19:15:07 -0800 Subject: [PATCH 1/6] centralize header with grid_renderer base type --- include/mapnik/grid/grid_renderer_base.hpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 include/mapnik/grid/grid_renderer_base.hpp diff --git a/include/mapnik/grid/grid_renderer_base.hpp b/include/mapnik/grid/grid_renderer_base.hpp new file mode 100644 index 000000000..be7dd41cf --- /dev/null +++ b/include/mapnik/grid/grid_renderer_base.hpp @@ -0,0 +1,36 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2012 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#ifndef MAPNIK_GRID_RENDERER_BASE_HPP +#define MAPNIK_GRID_RENDERER_BASE_HPP + +#include "agg_renderer_base.h" +#include +#include + +namespace mapnik { + +typedef agg::renderer_base grid_renderer_base_type; + +} + +#endif //MAPNIK_AGG_RASTERIZER_HPP From 1a771f07c6497358b35d05e59bd1a4f36411aa9a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 19:16:49 -0800 Subject: [PATCH 2/6] Add a 64 bit enabled grid type --- include/mapnik/grid/grid_pixel.hpp | 139 +++++++++++++++++++++++++++- include/mapnik/grid/grid_pixfmt.hpp | 7 +- 2 files changed, 144 insertions(+), 2 deletions(-) diff --git a/include/mapnik/grid/grid_pixel.hpp b/include/mapnik/grid/grid_pixel.hpp index 409b50113..8aa713076 100644 --- a/include/mapnik/grid/grid_pixel.hpp +++ b/include/mapnik/grid/grid_pixel.hpp @@ -165,7 +165,7 @@ struct gray16 static self_type no_color() { return self_type(0,0); } }; -//==================================================================gray16 +//==================================================================gray32 struct gray32 { typedef agg::int32 value_type; @@ -302,6 +302,143 @@ struct gray32 static self_type no_color() { return self_type(0,0); } }; +//==================================================================gray64 +struct gray64 +{ + typedef agg::int64 value_type; + typedef agg::int64u calc_type; + typedef agg::int64 long_type; + enum base_scale_e + { + base_shift = 32, + base_scale = 1 << base_shift, + base_mask = base_scale - 1 + }; + typedef gray64 self_type; + + value_type v; + value_type a; + + //-------------------------------------------------------------------- + gray64() {} + + //-------------------------------------------------------------------- + gray64(value_type v_, value_type a_=base_mask) : + v(v_), a(a_) {} + + //-------------------------------------------------------------------- + gray64(const self_type& c, unsigned a_) : + v(c.v), a(value_type(a_)) {} + + //-------------------------------------------------------------------- + void clear() + { + v = a = 0; + } + + //-------------------------------------------------------------------- + const self_type& transparent() + { + a = 0; + return *this; + } + + //-------------------------------------------------------------------- + void opacity(double a_) + { + if(a_ < 0.0) a_ = 0.0; + if(a_ > 1.0) a_ = 1.0; + a = (value_type)agg::uround(a_ * double(base_mask)); + } + + //-------------------------------------------------------------------- + double opacity() const + { + return double(a) / double(base_mask); + } + + + //-------------------------------------------------------------------- + const self_type& premultiply() + { + if(a == base_mask) return *this; + if(a == 0) + { + v = 0; + return *this; + } + v = value_type((calc_type(v) * a) >> base_shift); + return *this; + } + + //-------------------------------------------------------------------- + const self_type& premultiply(unsigned a_) + { + if(a == base_mask && a_ >= base_mask) return *this; + if(a == 0 || a_ == 0) + { + v = a = 0; + return *this; + } + calc_type v_ = (calc_type(v) * a_) / a; + v = value_type((v_ > a_) ? a_ : v_); + a = value_type(a_); + return *this; + } + + //-------------------------------------------------------------------- + const self_type& demultiply() + { + if(a == base_mask) return *this; + if(a == 0) + { + v = 0; + return *this; + } + calc_type v_ = (calc_type(v) * base_mask) / a; + v = value_type((v_ > base_mask) ? base_mask : v_); + return *this; + } + + //-------------------------------------------------------------------- + self_type gradient(self_type c, double k) const + { + self_type ret; + calc_type ik = agg::uround(k * base_scale); + ret.v = value_type(calc_type(v) + (((calc_type(c.v) - v) * ik) >> base_shift)); + ret.a = value_type(calc_type(a) + (((calc_type(c.a) - a) * ik) >> base_shift)); + return ret; + } + + //-------------------------------------------------------------------- + AGG_INLINE void add(const self_type& c, unsigned cover) + { + calc_type cv, ca; + if(cover == agg::cover_mask) + { + if(c.a == base_mask) + { + *this = c; + } + else + { + cv = v + c.v; v = (cv > calc_type(base_mask)) ? calc_type(base_mask) : cv; + ca = a + c.a; a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; + } + } + else + { + cv = v + ((c.v * cover + agg::cover_mask/2) >> agg::cover_shift); + ca = a + ((c.a * cover + agg::cover_mask/2) >> agg::cover_shift); + v = (cv > calc_type(base_mask)) ? calc_type(base_mask) : cv; + a = (ca > calc_type(base_mask)) ? calc_type(base_mask) : ca; + } + } + + //-------------------------------------------------------------------- + static self_type no_color() { return self_type(0,0); } +}; + } #endif diff --git a/include/mapnik/grid/grid_pixfmt.hpp b/include/mapnik/grid/grid_pixfmt.hpp index 55dc6751d..315d89109 100644 --- a/include/mapnik/grid/grid_pixfmt.hpp +++ b/include/mapnik/grid/grid_pixfmt.hpp @@ -638,7 +638,12 @@ typedef pixfmt_alpha_blend_gray blender_gray32; typedef pixfmt_alpha_blend_gray pixfmt_gray32; //----pixfmt_gray16 + mapnik::grid_rendering_buffer> pixfmt_gray32; //----pixfmt_gray32 + +typedef blender_gray blender_gray64; + +typedef pixfmt_alpha_blend_gray pixfmt_gray64; //----pixfmt_gray64 } From fa1ac1307f8aca14a1049476fcbf0d431bf4a87e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 19:17:42 -0800 Subject: [PATCH 3/6] use grid value_type instead of hardcoding int for feature id type --- src/grid/grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp index 883901656..f3815df37 100644 --- a/src/grid/grid.cpp +++ b/src/grid/grid.cpp @@ -80,7 +80,7 @@ void hit_grid::clear() template void hit_grid::add_feature(mapnik::feature_impl & feature) { - int feature_id = feature.id(); + value_type feature_id = feature.id(); // avoid adding duplicate features (e.g. in the case of both a line symbolizer and a polygon symbolizer) typename feature_key_type::const_iterator feature_pos = f_keys_.find(feature_id); if (feature_pos != f_keys_.end()) From 326b9801721db5423f6111047b1c53c8b86ed21e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 19:19:30 -0800 Subject: [PATCH 4/6] cleanup usage of grid pixel types --- include/mapnik/grid/grid_renderer_base.hpp | 2 +- src/grid/grid_renderer.cpp | 18 ++++++++--------- src/grid/process_building_symbolizer.cpp | 20 +++++++++---------- src/grid/process_line_pattern_symbolizer.cpp | 16 +++++++-------- src/grid/process_line_symbolizer.cpp | 14 ++++++------- src/grid/process_markers_symbolizer.cpp | 12 +++++------ src/grid/process_point_symbolizer.cpp | 3 +-- .../process_polygon_pattern_symbolizer.cpp | 17 ++++++++-------- src/grid/process_polygon_symbolizer.cpp | 18 ++++++++--------- src/grid/process_shield_symbolizer.cpp | 3 +-- 10 files changed, 59 insertions(+), 64 deletions(-) diff --git a/include/mapnik/grid/grid_renderer_base.hpp b/include/mapnik/grid/grid_renderer_base.hpp index be7dd41cf..b21601827 100644 --- a/include/mapnik/grid/grid_renderer_base.hpp +++ b/include/mapnik/grid/grid_renderer_base.hpp @@ -29,7 +29,7 @@ namespace mapnik { -typedef agg::renderer_base grid_renderer_base_type; +typedef agg::renderer_base grid_renderer_base_type; } diff --git a/src/grid/grid_renderer.cpp b/src/grid/grid_renderer.cpp index 799379858..579e49dcc 100644 --- a/src/grid/grid_renderer.cpp +++ b/src/grid/grid_renderer.cpp @@ -23,8 +23,7 @@ // mapnik #include #include -#include -#include +#include #include #include @@ -130,15 +129,16 @@ void grid_renderer::render_marker(mapnik::feature_impl & feature, unsigned in if (marker.is_vector()) { typedef coord_transform path_type; - typedef agg::renderer_base ren_base; - typedef agg::renderer_scanline_bin_solid renderer; + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + typedef agg::renderer_scanline_bin_solid renderer_type; agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_); - mapnik::pixfmt_gray32 pixf(buf); + pixfmt_type pixf(buf); - ren_base renb(pixf); - renderer ren(renb); + grid_renderer_base_type renb(pixf); + renderer_type ren(renb); ras_ptr->reset(); @@ -156,8 +156,8 @@ void grid_renderer::render_marker(mapnik::feature_impl & feature, unsigned in svg_path_adapter svg_path(stl_storage); svg_renderer_agg, - renderer, - mapnik::pixfmt_gray32> svg_renderer(svg_path, + renderer_type, + pixfmt_type> svg_renderer(svg_path, (*marker.get_vector_data())->attributes()); svg_renderer.render_id(*ras_ptr, sl, renb, feature.id(), mtx, opacity, bbox); diff --git a/src/grid/process_building_symbolizer.cpp b/src/grid/process_building_symbolizer.cpp index 74ef402f9..7cc8a3c38 100644 --- a/src/grid/process_building_symbolizer.cpp +++ b/src/grid/process_building_symbolizer.cpp @@ -23,8 +23,7 @@ // mapnik #include #include -#include -#include +#include #include #include #include @@ -49,16 +48,17 @@ void grid_renderer::process(building_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + typedef agg::renderer_scanline_bin_solid renderer_type; typedef coord_transform path_type; - typedef agg::renderer_base ren_base; - typedef agg::renderer_scanline_bin_solid renderer; agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_); - mapnik::pixfmt_gray32 pixf(buf); + pixfmt_type pixf(buf); - ren_base renb(pixf); - renderer ren(renb); + grid_renderer_base_type renb(pixf); + renderer_type ren(renb); ras_ptr->reset(); @@ -111,7 +111,7 @@ void grid_renderer::process(building_symbolizer const& sym, path_type faces_path (t_,*faces,prj_trans); ras_ptr->add_path(faces_path); - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); ras_ptr->reset(); @@ -138,13 +138,13 @@ void grid_renderer::process(building_symbolizer const& sym, path_type path(t_,*frame,prj_trans); agg::conv_stroke stroke(path); ras_ptr->add_path(stroke); - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); ras_ptr->reset(); path_type roof_path (t_,*roof,prj_trans); ras_ptr->add_path(roof_path); - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); } } diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index 7fe702e43..d18ccbca9 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -23,8 +23,7 @@ // mapnik #include #include -#include -#include +#include #include #include @@ -46,15 +45,16 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, proj_transform const& prj_trans) { typedef coord_transform path_type; - typedef agg::renderer_base ren_base; - typedef agg::renderer_scanline_bin_solid renderer; + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + typedef agg::renderer_scanline_bin_solid renderer_type; agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_); - mapnik::pixfmt_gray32 pixf(buf); + pixfmt_type pixf(buf); - ren_base renb(pixf); - renderer ren(renb); + grid_renderer_base_type renb(pixf); + renderer_type ren(renb); ras_ptr->reset(); @@ -75,7 +75,7 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, } // render id - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); // add feature properties to grid cache diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index be50bdfef..f48be155f 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -23,8 +23,7 @@ // mapnik #include #include -#include -#include +#include #include #include @@ -50,17 +49,18 @@ void grid_renderer::process(line_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - typedef agg::renderer_base renderer_base; - typedef agg::renderer_scanline_bin_solid renderer_type; + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + typedef agg::renderer_scanline_bin_solid renderer_type; typedef boost::mpl::vector conv_types; agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_); - mapnik::pixfmt_gray32 pixf(buf); + pixfmt_type pixf(buf); - renderer_base renb(pixf); + grid_renderer_base_type renb(pixf); renderer_type ren(renb); ras_ptr->reset(); @@ -103,7 +103,7 @@ void grid_renderer::process(line_symbolizer const& sym, } // render id - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::render_scanlines(*ras_ptr, sl, ren); // add feature properties to grid cache diff --git a/src/grid/process_markers_symbolizer.cpp b/src/grid/process_markers_symbolizer.cpp index ef8792e1a..41920aaa9 100644 --- a/src/grid/process_markers_symbolizer.cpp +++ b/src/grid/process_markers_symbolizer.cpp @@ -28,7 +28,6 @@ porting notes --> - current_buffer_ -> pixmap_ - agg::rendering_buffer -> grid_renderering_buffer - no gamma - - mapnik::pixfmt_gray32 - agg::scanline_bin sl - grid_rendering_buffer - agg::renderer_scanline_bin_solid @@ -45,8 +44,7 @@ porting notes --> // mapnik #include #include -#include -#include +#include #include #include @@ -84,9 +82,9 @@ void grid_renderer::process(markers_symbolizer const& sym, proj_transform const& prj_trans) { typedef grid_rendering_buffer buf_type; - typedef mapnik::pixfmt_gray32 pixfmt_type; - typedef agg::renderer_base renderer_base; - typedef agg::renderer_scanline_bin_solid renderer_type; + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + typedef agg::renderer_scanline_bin_solid renderer_type; typedef label_collision_detector4 detector_type; typedef boost::mpl::vector conv_types; @@ -221,7 +219,7 @@ void grid_renderer::process(markers_symbolizer const& sym, typedef raster_markers_rasterizer_dispatch_grid dispatch_type; diff --git a/src/grid/process_point_symbolizer.cpp b/src/grid/process_point_symbolizer.cpp index 056645a0a..9e4d9eecd 100644 --- a/src/grid/process_point_symbolizer.cpp +++ b/src/grid/process_point_symbolizer.cpp @@ -23,8 +23,7 @@ // mapnik #include #include -#include -#include +#include #include #include diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index 27ada8d45..5e1518e51 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -26,8 +26,7 @@ // mapnik #include #include -#include -#include +#include #include #include #include @@ -71,18 +70,18 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, converter.apply(geom); } } - - typedef agg::renderer_base ren_base; - typedef agg::renderer_scanline_bin_solid renderer; + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + typedef agg::renderer_scanline_bin_solid renderer_type; grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_); - mapnik::pixfmt_gray32 pixf(buf); + pixfmt_type pixf(buf); - ren_base renb(pixf); - renderer ren(renb); + grid_renderer_base_type renb(pixf); + renderer_type ren(renb); // render id - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::scanline_bin sl; agg::render_scanlines(*ras_ptr, sl, ren); diff --git a/src/grid/process_polygon_symbolizer.cpp b/src/grid/process_polygon_symbolizer.cpp index 281c300d6..25e57f9bd 100644 --- a/src/grid/process_polygon_symbolizer.cpp +++ b/src/grid/process_polygon_symbolizer.cpp @@ -26,8 +26,7 @@ // mapnik #include #include -#include -#include +#include #include #include #include @@ -48,6 +47,10 @@ void grid_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { + typedef agg::renderer_scanline_bin_solid renderer_type; + typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type; + typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type; + ras_ptr->reset(); agg::trans_affine tr; @@ -73,17 +76,14 @@ void grid_renderer::process(polygon_symbolizer const& sym, } } - typedef agg::renderer_base ren_base; - typedef agg::renderer_scanline_bin_solid renderer; - grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_); - mapnik::pixfmt_gray32 pixf(buf); + pixfmt_type pixf(buf); - ren_base renb(pixf); - renderer ren(renb); + grid_renderer_base_type renb(pixf); + renderer_type ren(renb); // render id - ren.color(mapnik::gray32(feature.id())); + ren.color(color_type(feature.id())); agg::scanline_bin sl; agg::render_scanlines(*ras_ptr, sl, ren); diff --git a/src/grid/process_shield_symbolizer.cpp b/src/grid/process_shield_symbolizer.cpp index 533507b80..8534721e8 100644 --- a/src/grid/process_shield_symbolizer.cpp +++ b/src/grid/process_shield_symbolizer.cpp @@ -23,8 +23,7 @@ // mapnik #include #include -#include -#include +#include #include #include From 619cfbc1bc9caa54645d72d079402649a2f1707f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 20:03:06 -0800 Subject: [PATCH 5/6] build less to reduce build time --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 557c1a5f4..5bcd94fb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev python-nose libicu-dev libpng-dev libjpeg-dev libtiff-dev libz-dev libfreetype6-dev libxml2-dev libproj-dev libpq-dev libgdal-dev libcairomm-1.0-dev python-cairo-dev libsqlite3-dev -script: scons configure JOBS=2 FAST=True CXX="$CXX $CXX_SCONS" WARNING_CXXFLAGS=$WARNING_CXXFLAGS && sudo make install +script: scons configure DEMO=False CAIRO=False INPUT_PLUGINS=shape,csv,osm OPTIMIZATION=2 JOBS=2 FAST=True CXX="$CXX $CXX_SCONS" WARNING_CXXFLAGS=$WARNING_CXXFLAGS && sudo make install From 6590225ce0ed65b1ae4bdd83db7dfc36ea83205a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 20:12:13 -0800 Subject: [PATCH 6/6] disable C++ tests for travis build to speed up overall compile --- .travis.yml | 2 +- SConstruct | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5bcd94fb2..26e6ee447 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev python-nose libicu-dev libpng-dev libjpeg-dev libtiff-dev libz-dev libfreetype6-dev libxml2-dev libproj-dev libpq-dev libgdal-dev libcairomm-1.0-dev python-cairo-dev libsqlite3-dev -script: scons configure DEMO=False CAIRO=False INPUT_PLUGINS=shape,csv,osm OPTIMIZATION=2 JOBS=2 FAST=True CXX="$CXX $CXX_SCONS" WARNING_CXXFLAGS=$WARNING_CXXFLAGS && sudo make install +script: scons configure DEMO=False CPP_TESTS=False CAIRO=False INPUT_PLUGINS=shape,csv,osm OPTIMIZATION=2 JOBS=2 FAST=True CXX="$CXX $CXX_SCONS" WARNING_CXXFLAGS=$WARNING_CXXFLAGS && sudo make install diff --git a/SConstruct b/SConstruct index 7c035a09f..79150c9ce 100644 --- a/SConstruct +++ b/SConstruct @@ -326,6 +326,7 @@ opts.AddVariables( BoolVariable('RENDERING_STATS', 'Output rendering statistics during style processing', 'False'), BoolVariable('SVG_RENDERER', 'build support for native svg renderer', 'False'), + BoolVariable('CPP_TESTS', 'Compile the C++ tests', 'True'), # Variables for optional dependencies ('GEOS_CONFIG', 'The path to the geos-config executable.', 'geos-config'), @@ -1742,7 +1743,8 @@ if not HELP_REQUESTED: # build C++ tests # not ready for release - SConscript('tests/cpp_tests/build.py') + if env['CPP_TESTS']: + SConscript('tests/cpp_tests/build.py') # not currently maintained # https://github.com/mapnik/mapnik/issues/1438