diff --git a/README.md b/README.md index 47c6a8d1d..78dd3c576 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,12 @@ implemented in C++11, currently targeting iOS, OS X, and Ubuntu Linux. # Depends - Modern C++ compiler that supports `-std=c++11` + - Boost headers - `libpng` - `libuv` - - `libcurl` (depends on OpenSSL; Linux only) - `glfw3` - - Boost + - `libcurl` (depends on OpenSSL; Linux only) + - `libboost_regex` (Linux only) - Python (for build only) - Node.js (for build only) diff --git a/linux/llmr-app.gyp b/linux/llmr-app.gyp index 75fd0dfe3..2a57515cd 100644 --- a/linux/llmr-app.gyp +++ b/linux/llmr-app.gyp @@ -43,7 +43,7 @@ 'link_settings': { 'libraries': [ '<@(glfw3_libraries)', - '<@(curl_libraries)', + '<@(curl_libraries)' ], }, }], diff --git a/llmr.gyp b/llmr.gyp index a32a598f5..9b848b8bb 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -191,6 +191,7 @@ 'libraries': [ '<@(png_libraries)', '<@(uv_libraries)', + '-lboost_regex' ] }] ] diff --git a/setup-libraries.sh b/setup-libraries.sh index f37a67cb0..e0b03637e 100755 --- a/setup-libraries.sh +++ b/setup-libraries.sh @@ -95,6 +95,7 @@ source Linux.sh if [ ! -f out/build-cpp11-libstdcpp-gcc-x86_64/lib/libssl.a ] ; then ./scripts/build_openssl.sh ; fi if [ ! -f out/build-cpp11-libstdcpp-gcc-x86_64/lib/libcurl.a ] ; then ./scripts/build_curl.sh ; fi if [ ! -d out/build-cpp11-libstdcpp-gcc-x86_64/include/boost ] ; then ./scripts/build_boost.sh `pwd`/../../src/ `pwd`/../../include/ `pwd`/../../linux/ `pwd`/../../common/ ; fi + if [ ! -d out/build-cpp11-libstdcpp-gcc-x86_64/lib/libboost_regex.a ] ; then ./scripts/build_boost.sh --with-regex ; fi cd ../../ ./configure \ diff --git a/src/map/tile_parser.cpp b/src/map/tile_parser.cpp index ecd15adbb..ad0fb2d71 100644 --- a/src/map/tile_parser.cpp +++ b/src/map/tile_parser.cpp @@ -16,7 +16,13 @@ #include #include +#ifdef __linux__ +#include +namespace regex_impl = boost; +#else #include +namespace regex_impl = std; +#endif using namespace llmr; @@ -184,8 +190,8 @@ std::unique_ptr TileParser::createTextBucket(const VectorTileLayer &laye tile.textVertexBuffer, tile.triangleElementsBuffer, bucket_desc, placement); util::utf8_to_utf32 ucs4conv; - std::regex token_regex("\\{\\{(\\w+)\\}\\}"); - const auto tokens_end = std::sregex_token_iterator(); + regex_impl::regex token_regex("\\{\\{(\\w+)\\}\\}"); + const auto tokens_end = regex_impl::sregex_token_iterator(); std::vector> labels; @@ -205,7 +211,7 @@ std::unique_ptr TileParser::createTextBucket(const VectorTileLayer &laye source_string.reserve(field.size()); bool token = false; - for (auto token_it = std::sregex_token_iterator(field.begin(), field.end(), token_regex, {-1, 1}); token_it != tokens_end; ++token_it, token = !token) { + for (auto token_it = regex_impl::sregex_token_iterator(field.begin(), field.end(), token_regex, {-1, 1}); token_it != tokens_end; ++token_it, token = !token) { if (!token_it->matched) { continue; }