increase template depth on clang and gcc builds
This commit is contained in:
parent
0f59b78c02
commit
d5904d5756
@ -282,7 +282,7 @@ endif()
|
||||
|
||||
# Configuring compilers
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||
@ -290,7 +290,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(COLOR_FLAG "")
|
||||
endif()
|
||||
# using GCC
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||
if(WIN32) # using mingw
|
||||
add_dependency_defines(-DWIN32)
|
||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||
@ -465,6 +465,33 @@ else()
|
||||
find_package(GDAL)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
# Now fall back to a lua verison without exact
|
||||
# in case this cmake version also forces patch versions
|
||||
FIND_PACKAGE(Lua 5.2)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
# add a target to generate API documentation with Doxygen
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
@ -504,33 +531,6 @@ if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
# Now fall back to a lua verison without exact
|
||||
# in case this cmake version also forces patch versions
|
||||
FIND_PACKAGE(Lua 5.2)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
|
@ -96,7 +96,6 @@ struct ExtractionWay
|
||||
bool roundabout;
|
||||
bool circular;
|
||||
bool is_startpoint;
|
||||
bool ignore_in_grid;
|
||||
TravelMode forward_travel_mode : 4;
|
||||
TravelMode backward_travel_mode : 4;
|
||||
guidance::RoadClassification road_classification;
|
||||
|
@ -19,8 +19,8 @@ namespace extractor
|
||||
|
||||
struct Sol2ScriptingContext final
|
||||
{
|
||||
void processNode(const osmium::Node &, ExtractionNode &result);
|
||||
void processWay(const osmium::Way &, ExtractionWay &result);
|
||||
void ProcessNode(const osmium::Node &, ExtractionNode &result);
|
||||
void ProcessWay(const osmium::Way &, ExtractionWay &result);
|
||||
|
||||
ProfileProperties properties;
|
||||
SourceContainer sources;
|
@ -164,13 +164,12 @@ function way_function (way, result)
|
||||
-- speed
|
||||
if route_speeds[route] then
|
||||
-- ferries (doesn't cover routes tagged using relations)
|
||||
result.ignore_in_grid = true
|
||||
if duration and durationIsValid(duration) then
|
||||
result.duration = math.max( 1, parseDuration(duration) )
|
||||
else
|
||||
result.forward_speed = route_speeds[route]
|
||||
result.backward_speed = route_speeds[route]
|
||||
end
|
||||
if duration and durationIsValid(duration) then
|
||||
result.duration = math.max( 1, parseDuration(duration) )
|
||||
else
|
||||
result.forward_speed = route_speeds[route]
|
||||
result.backward_speed = route_speeds[route]
|
||||
end
|
||||
result.forward_mode = mode.ferry
|
||||
result.backward_mode = mode.ferry
|
||||
elseif railway and platform_speeds[railway] then
|
||||
|
@ -18,13 +18,18 @@ VARIANT_TAG=v1.1.0
|
||||
MASON_REPO=https://github.com/mapbox/mason.git
|
||||
MASON_TAG=v0.1.1
|
||||
|
||||
SOL_REPO="https://github.com/ThePhD/sol2.git"
|
||||
SOL_TAG=v2.15.4
|
||||
|
||||
VARIANT_LATEST=$(curl https://api.github.com/repos/mapbox/variant/releases/latest | jq ".tag_name")
|
||||
OSMIUM_LATEST=$(curl https://api.github.com/repos/osmcode/libosmium/releases/latest | jq ".tag_name")
|
||||
MASON_LATEST=$(curl https://api.github.com/repos/mapbox/mason/releases/latest | jq ".tag_name")
|
||||
SOL_LATEST=$(curl "https://api.github.com/repos/ThePhD/sol2/releases/latest" | jq ".tag_name")
|
||||
|
||||
echo "Latest osmium release is $OSMIUM_LATEST, pulling in \"$OSMIUM_TAG\""
|
||||
echo "Latest variant release is $VARIANT_LATEST, pulling in \"$VARIANT_TAG\""
|
||||
echo "Latest mason release is $MASON_LATEST, pulling in \"$MASON_TAG\""
|
||||
echo "Latest sol2 release is $SOL_LATEST, pulling in \"$SOL_TAG\""
|
||||
|
||||
read -p "Looks good? (Y/n) " ok
|
||||
|
||||
@ -33,4 +38,5 @@ then
|
||||
git subtree pull -P third_party/libosmium/ $OSMIUM_REPO $OSMIUM_TAG --squash
|
||||
git subtree pull -P third_party/variant/ $VARIANT_REPO $VARIANT_TAG --squash
|
||||
git subtree pull -P third_party/mason/ $MASON_REPO $MASON_TAG --squash
|
||||
git subtree pull -P third_party/sol2/sol2/ $SOL_REPO $SOL_TAG --squash
|
||||
fi
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "extractor/scripting_environment_sol2.hpp"
|
||||
#include "extractor/scripting_environment_lua.hpp"
|
||||
|
||||
#include "extractor/external_memory_node.hpp"
|
||||
#include "extractor/extraction_helper_functions.hpp"
|
||||
@ -11,7 +11,7 @@
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/lua_util.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/log.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <osmium/osm.hpp>
|
||||
@ -79,7 +79,7 @@ auto get_nodes_for_way(const osmium::Way &way) -> decltype(way.nodes()) { return
|
||||
Sol2ScriptingEnvironment::Sol2ScriptingEnvironment(const std::string &file_name)
|
||||
: file_name(file_name)
|
||||
{
|
||||
util::SimpleLogger().Write() << "Using script " << file_name;
|
||||
util::Log() << "Using script " << file_name;
|
||||
}
|
||||
|
||||
void Sol2ScriptingEnvironment::InitContext(Sol2ScriptingContext &context)
|
||||
@ -348,7 +348,7 @@ void Sol2ScriptingEnvironment::ProcessElements(
|
||||
result_node.clear();
|
||||
if (local_context.has_node_function)
|
||||
{
|
||||
local_context.processNode(static_cast<const osmium::Node &>(*entity),
|
||||
local_context.ProcessNode(static_cast<const osmium::Node &>(*entity),
|
||||
result_node);
|
||||
}
|
||||
resulting_nodes.push_back(std::make_pair(x, std::move(result_node)));
|
||||
@ -357,7 +357,7 @@ void Sol2ScriptingEnvironment::ProcessElements(
|
||||
result_way.clear();
|
||||
if (local_context.has_way_function)
|
||||
{
|
||||
local_context.processWay(static_cast<const osmium::Way &>(*entity),
|
||||
local_context.ProcessWay(static_cast<const osmium::Way &>(*entity),
|
||||
result_way);
|
||||
}
|
||||
resulting_ways.push_back(std::make_pair(x, std::move(result_way)));
|
||||
@ -452,7 +452,7 @@ void Sol2ScriptingEnvironment::ProcessSegment(const osrm::util::Coordinate &sour
|
||||
}
|
||||
}
|
||||
|
||||
void Sol2ScriptingContext::processNode(const osmium::Node &node, ExtractionNode &result)
|
||||
void Sol2ScriptingContext::ProcessNode(const osmium::Node &node, ExtractionNode &result)
|
||||
{
|
||||
BOOST_ASSERT(state.lua_state() != nullptr);
|
||||
|
||||
@ -461,7 +461,7 @@ void Sol2ScriptingContext::processNode(const osmium::Node &node, ExtractionNode
|
||||
node_function(node, result);
|
||||
}
|
||||
|
||||
void Sol2ScriptingContext::processWay(const osmium::Way &way, ExtractionWay &result)
|
||||
void Sol2ScriptingContext::ProcessWay(const osmium::Way &way, ExtractionWay &result)
|
||||
{
|
||||
BOOST_ASSERT(state.lua_state() != nullptr);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "extractor/extractor.hpp"
|
||||
#include "extractor/extractor_config.hpp"
|
||||
#include "extractor/scripting_environment_sol2.hpp"
|
||||
#include "extractor/scripting_environment_lua.hpp"
|
||||
#include "util/log.hpp"
|
||||
#include "util/version.hpp"
|
||||
|
||||
|
25856
third_party/sol2/sol2/sol.hpp
vendored
25856
third_party/sol2/sol2/sol.hpp
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user