File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,7 @@ set(SERVUS_SOURCES
4040 uri.cpp
4141 )
4242
43- list (APPEND SERVUS_LINK_LIBRARIES PRIVATE ${CMAKE_THREAD_LIBS_INIT}
44- ${Boost_REGEX_LIBRARY} )
43+ list (APPEND SERVUS_LINK_LIBRARIES PRIVATE ${CMAKE_THREAD_LIBS_INIT} )
4544if (MSVC )
4645 list (APPEND SERVUS_LINK_LIBRARIES ws2_32)
4746endif ()
@@ -55,6 +54,9 @@ if(COMMON_USE_CXX03)
5554 list (APPEND SERVUS_LINK_LIBRARIES ${Boost_SYSTEM_LIBRARY}
5655 ${Boost_CHRONO_LIBRARY} )
5756endif ()
57+ if (BOOST_FOUND)
58+ list (APPEND SERVUS_LINK_LIBRARIES PRIVATE ${Boost_REGEX_LIBRARY} )
59+ endif ()
5860
5961set (SERVUS_OMIT_LIBRARY_HEADER ON )
6062common_library(Servus)
Original file line number Diff line number Diff line change 2727#include < sstream>
2828#include < stdexcept>
2929
30+ #ifdef SERVUS_USE_BOOST
3031#include < boost/regex.hpp>
32+ #endif
3133
3234namespace servus
3335{
@@ -149,21 +151,25 @@ void _parseAuthority( URIData& data, const std::string& auth )
149151 throw std::invalid_argument (" " );
150152}
151153
154+ #ifdef SERVUS_USE_BOOST
152155void _warnAboutLegacySeparator ( const std::string& query )
153156{
154157 const boost::regex legacySeparator ( " [^&]*,[^&]*=" );
155158 if ( boost::regex_search ( query, legacySeparator ))
156159 std::cerr << " servus::URI: Detected legacy ',' separator in query: \" "
157160 << query << " \" . Use '&' separator instead." << std::endl;
158161}
162+ #endif
159163
160164void _parseQueryMap ( URIData& data )
161165{
162166 // parse query data into key-value pairs
163167 std::string query = data.query ;
164168
169+ #ifdef SERVUS_USE_BOOST
165170 // warn if a query uses the legacy ',' separator instead of '&'
166171 _warnAboutLegacySeparator ( query );
172+ #endif
167173
168174 data.queryMap .clear ();
169175 while ( !query.empty ( ))
You can’t perform that action at this time.
0 commit comments