break out wkt/json grammars into separate libraries

This commit is contained in:
Dane Springmeyer 2014-10-13 01:06:36 -07:00
parent 6b1c4d00e5
commit 44bc5b59d6
12 changed files with 47 additions and 8 deletions

View file

@ -1175,7 +1175,7 @@ if not preconfigured:
# Set up for libraries and headers dependency checks
env['CPPPATH'] = ['#include', '#']
env['LIBPATH'] = ['#src']
env['LIBPATH'] = ['#src','#src/json','#src/wkt']
# set any custom cxxflags and ldflags to come first
if sys.platform == 'darwin' and not env['HOST']:
@ -1916,6 +1916,10 @@ if not HELP_REQUESTED:
if env['RUNTIME_LINK'] == 'shared':
SConscript('deps/agg/build.py')
# Build spirit grammars
SConscript('src/json/build.py')
SConscript('src/wkt/build.py')
# Build the core library
SConscript('src/build.py')

View file

@ -183,9 +183,13 @@ if 'uninstall' not in COMMAND_LINE_TARGETS:
py_env.Append(CPPDEFINES = '-DHAVE_PYCAIRO')
py_env.Append(LINKFLAGS=python_link_flag)
py_env.AppendUnique(LIBS='mapnik_json_geometry_grammar')
py_env.AppendUnique(LIBS='mapnik_json_feature_grammar')
py_env.AppendUnique(LIBS='mapnik_json_generator_grammar')
_mapnik = py_env.LoadableModule('mapnik/_mapnik', sources, LDMODULEPREFIX='', LDMODULESUFFIX='.so')
Depends(_mapnik, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
Depends(_mapnik, env.subst('../../src/json/libmapnik_json_geometry_grammar${LIBSUFFIX}'))
if env['PLATFORM'] == 'SunOS' and env['PYTHON_IS_64BIT']:
# http://mail.python.org/pipermail/python-dev/2006-August/068528.html

View file

@ -37,6 +37,8 @@ plugin_sources = Split(
libraries = []
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('mapnik_json_geometry_grammar')
libraries.append('mapnik_wkt_grammar')
if env['PLUGIN_LINKING'] == 'shared':
libraries.append(env['MAPNIK_NAME'])
@ -49,6 +51,8 @@ if env['PLUGIN_LINKING'] == 'shared':
# if the plugin links to libmapnik ensure it is built first
Depends(TARGET, env.subst('../../../src/%s' % env['MAPNIK_LIB_NAME']))
Depends(TARGET, env.subst('../../../src/json/libmapnik_json_geometry_grammar${LIBSUFFIX}'))
Depends(TARGET, env.subst('../../../src/wkt/libmapnik_wkt_grammar${LIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(env['MAPNIK_INPUT_PLUGINS_DEST'], TARGET)

View file

@ -42,8 +42,6 @@
#include <mapnik/boolean.hpp>
#include <mapnik/util/trim.hpp>
#include <mapnik/value_types.hpp>
#include <mapnik/wkt/wkt_grammar_impl.hpp>
#include <mapnik/json/geometry_grammar_impl.hpp>
// stl
#include <sstream>

View file

@ -38,8 +38,9 @@ plugin_sources = Split(
libraries = []
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
#if env['THREADING'] == 'multi':
# libraries.append('boost_thread%s' % env['BOOST_APPEND'])
libraries.append('mapnik_json_geometry_grammar')
libraries.append('mapnik_json_feature_grammar')
libraries.append('mapnik_json_feature_collection_grammar')
if env['PLUGIN_LINKING'] == 'shared':
libraries.append(env['MAPNIK_NAME'])
@ -52,6 +53,9 @@ if env['PLUGIN_LINKING'] == 'shared':
# if the plugin links to libmapnik ensure it is built first
Depends(TARGET, env.subst('../../../src/%s' % env['MAPNIK_LIB_NAME']))
Depends(TARGET, env.subst('../../../src/json/libmapnik_json_geometry_grammar${LIBSUFFIX}'))
Depends(TARGET, env.subst('../../../src/json/libmapnik_json_feature_grammar${LIBSUFFIX}'))
Depends(TARGET, env.subst('../../../src/json/libmapnik_json_feature_collection_grammar${LIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(env['MAPNIK_INPUT_PLUGINS_DEST'], TARGET)

View file

@ -43,9 +43,6 @@
#include <mapnik/util/geometry_to_ds_type.hpp>
#include <mapnik/util/variant.hpp>
#include <mapnik/json/feature_collection_grammar.hpp>
#include <mapnik/json/feature_collection_grammar_impl.hpp>
#include <mapnik/json/feature_grammar_impl.hpp>
#include <mapnik/json/geometry_grammar_impl.hpp>
#include <boost/spirit/include/qi.hpp>

View file

@ -0,0 +1,28 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon
*
* 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
*
*****************************************************************************/
#include <mapnik/feature.hpp>
#include <mapnik/json/feature_collection_grammar_impl.hpp>
#include <string>
using iterator_type = std::string::const_iterator;
template struct mapnik::json::feature_collection_grammar<iterator_type,mapnik::feature_impl> ;