From 963bf5a4b72cfb076838c67c36fc18a6be08181d Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 6 Apr 2023 23:23:20 -0700 Subject: [PATCH] Refactor library translation units --- .drone/drone.sh | 5 + .github/workflows/ci.yml | 11 +- CMakeLists.txt | 14 +- antora/.gitignore | 3 + antora/mrdox.yml | 2 + build/Jamfile | 6 +- doc/qbk/1.0.overview.qbk | 14 -- doc/qbk/2.0.quicklook.qbk | 32 +---- example/Jamfile | 2 +- example/router/CMakeLists.txt | 11 +- example/router/Jamfile | 2 +- .../detail/impl/{router.ipp => router.cpp} | 1 + example/router/detail/router.hpp | 1 + .../router/impl/{matches.ipp => matches.cpp} | 0 example/router/matches.hpp | 1 + example/router/router.cpp | 1 - example/router/src.hpp | 22 ---- include/boost/url/detail/impl/path.ipp | 23 ---- include/boost/url/detail/normalize.hpp | 2 + include/boost/url/detail/print.hpp | 4 - .../url/grammar/detail/impl/ci_string.ipp | 81 ------------ include/boost/url/grammar/impl/error.hpp | 16 ++- .../boost/url/rfc/detail/reg_name_rule.hpp | 1 + include/boost/url/src.hpp | 120 ------------------ .../authority_view.cpp | 2 + .../decode_view.ipp => src/decode_view.cpp | 2 + .../detail/any_params_iter.cpp | 2 + .../detail/any_segments_iter.cpp | 2 + .../impl/decode.ipp => src/detail/decode.cpp | 2 + .../impl/except.ipp => src/detail/except.cpp | 1 + .../detail/format_args.cpp | 5 + .../normalize.ipp => src/detail/normalize.cpp | 7 +- .../detail/params_iter_impl.cpp | 1 + .../pattern.ipp => src/detail/pattern.cpp | 5 + .../detail/pct_format.cpp | 2 + .../detail/replacement_field_rule.cpp | 2 + .../detail/segments_iter_impl.cpp | 2 + .../url_impl.ipp => src/detail/url_impl.cpp | 2 + .../boost/url/impl/error.ipp => src/error.cpp | 8 +- .../grammar/ci_string.cpp | 1 + .../grammar/dec_octet_rule.cpp | 5 +- .../grammar/delim_rule.cpp | 2 + .../grammar/detail/recycled.cpp | 7 +- .../impl/error.ipp => src/grammar/error.cpp | 18 +++ .../grammar/literal_rule.cpp | 2 + .../grammar/string_view_base.cpp | 1 + .../ipv4_address.ipp => src/ipv4_address.cpp | 2 + .../ipv6_address.ipp => src/ipv6_address.cpp | 2 + .../params_base.ipp => src/params_base.cpp | 3 + .../params_encoded_base.cpp | 3 + .../params_encoded_ref.cpp | 2 + .../params_encoded_view.cpp | 1 + .../impl/params_ref.ipp => src/params_ref.cpp | 2 + .../params_view.ipp => src/params_view.cpp | 1 + .../boost/url/impl/parse.ipp => src/parse.cpp | 1 + .../impl/parse_path.ipp => src/parse_path.cpp | 1 + .../parse_query.ipp => src/parse_query.cpp | 1 + .../pct_string_view.cpp | 2 + .../rfc/absolute_uri_rule.cpp | 1 + .../rfc/authority_rule.cpp | 2 + .../rfc/detail/h16_rule.cpp | 2 + .../rfc/detail/hier_part_rule.cpp | 1 + .../rfc/detail/host_rule.cpp | 2 + .../rfc/detail/ip_literal_rule.cpp | 2 + .../rfc/detail/ipvfuture_rule.cpp | 2 + .../rfc/detail/port_rule.cpp | 1 + .../rfc/detail/relative_part_rule.cpp | 1 + .../rfc/detail/scheme_rule.cpp | 5 +- .../rfc/detail/userinfo_rule.cpp | 3 + .../rfc/ipv4_address_rule.cpp | 1 + .../rfc/ipv6_address_rule.cpp | 2 + .../rfc/origin_form_rule.cpp | 2 + .../query_rule.ipp => src/rfc/query_rule.cpp | 1 + .../rfc/relative_ref_rule.cpp | 2 + .../rfc/uri_reference_rule.cpp | 6 +- .../impl/uri_rule.ipp => src/rfc/uri_rule.cpp | 2 + .../url/impl/scheme.ipp => src/scheme.cpp | 1 + .../segments_base.cpp | 1 + .../segments_encoded_base.cpp | 1 + .../segments_encoded_ref.cpp | 1 + .../segments_encoded_view.cpp | 1 + .../segments_ref.ipp => src/segments_ref.cpp | 1 + .../segments_view.cpp | 1 + src/src.cpp | 10 -- .../impl/static_url.ipp => src/static_url.cpp | 2 + include/boost/url/impl/url.ipp => src/url.cpp | 5 +- .../url/impl/url_base.ipp => src/url_base.cpp | 6 + .../url/impl/url_view.ipp => src/url_view.cpp | 2 + .../url_view_base.cpp | 3 + test/limits/CMakeLists.txt | 15 ++- test/unit/CMakeLists.txt | 13 +- test/unit/Jamfile | 2 +- test/unit/example/router/router.cpp | 1 - 93 files changed, 222 insertions(+), 359 deletions(-) create mode 100644 antora/.gitignore create mode 100644 antora/mrdox.yml rename example/router/detail/impl/{router.ipp => router.cpp} (99%) rename example/router/impl/{matches.ipp => matches.cpp} (100%) delete mode 100644 example/router/src.hpp delete mode 100644 include/boost/url/detail/impl/path.ipp delete mode 100644 include/boost/url/grammar/detail/impl/ci_string.ipp delete mode 100644 include/boost/url/src.hpp rename include/boost/url/impl/authority_view.ipp => src/authority_view.cpp (99%) rename include/boost/url/impl/decode_view.ipp => src/decode_view.cpp (97%) rename include/boost/url/detail/impl/any_params_iter.ipp => src/detail/any_params_iter.cpp (99%) rename include/boost/url/detail/impl/any_segments_iter.ipp => src/detail/any_segments_iter.cpp (97%) rename include/boost/url/detail/impl/decode.ipp => src/detail/decode.cpp (97%) rename include/boost/url/detail/impl/except.ipp => src/detail/except.cpp (96%) rename include/boost/url/detail/impl/format_args.ipp => src/detail/format_args.cpp (98%) rename include/boost/url/detail/impl/normalize.ipp => src/detail/normalize.cpp (99%) rename include/boost/url/detail/impl/params_iter_impl.ipp => src/detail/params_iter_impl.cpp (99%) rename include/boost/url/detail/impl/pattern.ipp => src/detail/pattern.cpp (99%) rename include/boost/url/detail/impl/pct_format.ipp => src/detail/pct_format.cpp (98%) rename include/boost/url/detail/impl/replacement_field_rule.ipp => src/detail/replacement_field_rule.cpp (97%) rename include/boost/url/detail/impl/segments_iter_impl.ipp => src/detail/segments_iter_impl.cpp (97%) rename include/boost/url/detail/impl/url_impl.ipp => src/detail/url_impl.cpp (98%) rename include/boost/url/impl/error.ipp => src/error.cpp (93%) rename include/boost/url/grammar/impl/ci_string.ipp => src/grammar/ci_string.cpp (98%) rename include/boost/url/grammar/impl/dec_octet_rule.ipp => src/grammar/dec_octet_rule.cpp (93%) rename include/boost/url/grammar/impl/delim_rule.ipp => src/grammar/delim_rule.cpp (92%) rename include/boost/url/grammar/detail/impl/recycled.ipp => src/grammar/detail/recycled.cpp (94%) rename include/boost/url/grammar/impl/error.ipp => src/grammar/error.cpp (79%) rename include/boost/url/grammar/impl/literal_rule.ipp => src/grammar/literal_rule.cpp (94%) rename include/boost/url/grammar/impl/string_view_base.ipp => src/grammar/string_view_base.cpp (94%) rename include/boost/url/impl/ipv4_address.ipp => src/ipv4_address.cpp (97%) rename include/boost/url/impl/ipv6_address.ipp => src/ipv6_address.cpp (98%) rename include/boost/url/impl/params_base.ipp => src/params_base.cpp (96%) rename include/boost/url/impl/params_encoded_base.ipp => src/params_encoded_base.cpp (96%) rename include/boost/url/impl/params_encoded_ref.ipp => src/params_encoded_ref.cpp (98%) rename include/boost/url/impl/params_encoded_view.ipp => src/params_encoded_view.cpp (96%) rename include/boost/url/impl/params_ref.ipp => src/params_ref.cpp (98%) rename include/boost/url/impl/params_view.ipp => src/params_view.cpp (96%) rename include/boost/url/impl/parse.ipp => src/parse.cpp (97%) rename include/boost/url/impl/parse_path.ipp => src/parse_path.cpp (97%) rename include/boost/url/impl/parse_query.ipp => src/parse_query.cpp (96%) rename include/boost/url/impl/pct_string_view.ipp => src/pct_string_view.cpp (96%) rename include/boost/url/rfc/impl/absolute_uri_rule.ipp => src/rfc/absolute_uri_rule.cpp (98%) rename include/boost/url/rfc/impl/authority_rule.ipp => src/rfc/authority_rule.cpp (95%) rename include/boost/url/rfc/detail/impl/h16_rule.ipp => src/rfc/detail/h16_rule.cpp (95%) rename include/boost/url/rfc/detail/impl/hier_part_rule.ipp => src/rfc/detail/hier_part_rule.cpp (98%) rename include/boost/url/rfc/detail/impl/host_rule.ipp => src/rfc/detail/host_rule.cpp (97%) rename include/boost/url/rfc/detail/impl/ip_literal_rule.ipp => src/rfc/detail/ip_literal_rule.cpp (95%) rename include/boost/url/rfc/detail/impl/ipvfuture_rule.ipp => src/rfc/detail/ipvfuture_rule.cpp (95%) rename include/boost/url/rfc/detail/impl/port_rule.ipp => src/rfc/detail/port_rule.cpp (98%) rename include/boost/url/rfc/detail/impl/relative_part_rule.ipp => src/rfc/detail/relative_part_rule.cpp (98%) rename include/boost/url/rfc/detail/impl/scheme_rule.ipp => src/rfc/detail/scheme_rule.cpp (91%) rename include/boost/url/rfc/detail/impl/userinfo_rule.ipp => src/rfc/detail/userinfo_rule.cpp (92%) rename include/boost/url/rfc/impl/ipv4_address_rule.ipp => src/rfc/ipv4_address_rule.cpp (97%) rename include/boost/url/rfc/impl/ipv6_address_rule.ipp => src/rfc/ipv6_address_rule.cpp (98%) rename include/boost/url/rfc/impl/origin_form_rule.ipp => src/rfc/origin_form_rule.cpp (94%) rename include/boost/url/rfc/impl/query_rule.ipp => src/rfc/query_rule.cpp (98%) rename include/boost/url/rfc/impl/relative_ref_rule.ipp => src/rfc/relative_ref_rule.cpp (95%) rename include/boost/url/rfc/impl/uri_reference_rule.ipp => src/rfc/uri_reference_rule.cpp (86%) rename include/boost/url/rfc/impl/uri_rule.ipp => src/rfc/uri_rule.cpp (96%) rename include/boost/url/impl/scheme.ipp => src/scheme.cpp (98%) rename include/boost/url/impl/segments_base.ipp => src/segments_base.cpp (97%) rename include/boost/url/impl/segments_encoded_base.ipp => src/segments_encoded_base.cpp (98%) rename include/boost/url/impl/segments_encoded_ref.ipp => src/segments_encoded_ref.cpp (98%) rename include/boost/url/impl/segments_encoded_view.ipp => src/segments_encoded_view.cpp (96%) rename include/boost/url/impl/segments_ref.ipp => src/segments_ref.cpp (98%) rename include/boost/url/impl/segments_view.ipp => src/segments_view.cpp (95%) delete mode 100644 src/src.cpp rename include/boost/url/impl/static_url.ipp => src/static_url.cpp (94%) rename include/boost/url/impl/url.ipp => src/url.cpp (96%) rename include/boost/url/impl/url_base.ipp => src/url_base.cpp (99%) rename include/boost/url/impl/url_view.ipp => src/url_view.cpp (95%) rename include/boost/url/impl/url_view_base.ipp => src/url_view_base.cpp (99%) diff --git a/.drone/drone.sh b/.drone/drone.sh index 99e78c0e..b99f5f33 100755 --- a/.drone/drone.sh +++ b/.drone/drone.sh @@ -317,6 +317,11 @@ elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-install" ]; then # cp -r $DRONE_WORKSPACE/* libs/$SELF # git submodule update --init tools/boostdep git submodule update --init --recursive + if [ ! -d "libs/$SELF" ]; then + mkdir -p "libs/$SELF" + fi + find "libs/$SELF" -mindepth 1 -delete + mkdir -p "libs/$SELF" cp -r "$DRONE_WORKSPACE"/* "libs/$SELF" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9b5cd1d..747beafe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,13 @@ name: CI on: pull_request: - push: branches: - master - develop - feature/** + push: + branches: + - '*' concurrency: group: ${{format('{0}:{1}', github.repository, github.ref)}} @@ -324,7 +326,10 @@ jobs: # cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY # git submodule update --init tools/boostdep git submodule update --init --recursive - mkdir -p libs/$LIBRARY + if [ ! -d "libs/$LIBRARY" ]; then + mkdir -p libs/$LIBRARY + fi + find libs/$LIBRARY -mindepth 1 -delete cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY DEPINST_ARGS+=("$LIBRARY") @@ -453,6 +458,8 @@ jobs: - { os: ubuntu-22.04, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' } - { os: windows-2019, build_shared: ON, build_type: Debug, generator: 'Visual Studio 16 2019' } - { os: windows-2019, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 16 2019' } + - { os: windows-2022, build_shared: ON, build_type: Debug, generator: 'Visual Studio 17 2022' } + - { os: windows-2022, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 17 2022' } timeout-minutes: 120 runs-on: ${{matrix.os}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 506e128e..bd5951e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,13 @@ function(boost_url_setup_properties target) Boost::variant2 ) endif() + + if(BUILD_SHARED_LIBS) + target_compile_definitions(${target} PUBLIC BOOST_URL_DYN_LINK=1) + else() + target_compile_definitions(${target} PUBLIC BOOST_URL_STATIC_LINK=1) + endif() + target_compile_definitions(${target} PRIVATE BOOST_URL_SOURCE) endfunction() @@ -104,13 +111,12 @@ file(GLOB_RECURSE BOOST_URL_HEADERS CONFIGURE_DEPENDS include/boost/*.natvis ) -set(BOOST_URL_SOURCES src/src.cpp) +file(GLOB_RECURSE BOOST_URL_SOURCES CONFIGURE_DEPENDS src/*.cpp) set_property(GLOBAL PROPERTY USE_FOLDERS ON) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_URL_HEADERS}) -source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "" FILES ${BOOST_URL_SOURCES}) - +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "url" FILES ${BOOST_URL_SOURCES}) add_library(boost_url ${BOOST_URL_HEADERS} ${BOOST_URL_SOURCES}) add_library(Boost::url ALIAS boost_url) @@ -121,6 +127,8 @@ if(BUILD_SHARED_LIBS) else() target_compile_definitions(boost_url PUBLIC BOOST_URL_STATIC_LINK=1) endif() +target_compile_definitions(boost_url PRIVATE BOOST_URL_SOURCE) + if(BOOST_URL_INSTALL AND NOT BOOST_SUPERPROJECT_VERSION) diff --git a/antora/.gitignore b/antora/.gitignore new file mode 100644 index 00000000..cc40d053 --- /dev/null +++ b/antora/.gitignore @@ -0,0 +1,3 @@ +index.adoc +index.xml +compile_commands.json diff --git a/antora/mrdox.yml b/antora/mrdox.yml new file mode 100644 index 00000000..7b954905 --- /dev/null +++ b/antora/mrdox.yml @@ -0,0 +1,2 @@ +include: + - ../include diff --git a/build/Jamfile b/build/Jamfile index 1bb70e50..eeacf0d2 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -11,19 +11,17 @@ project boost/url : requirements $(c11-requires) - shared:BOOST_URL_DYN_LINK=1 - static:BOOST_URL_STATIC_LINK=1 BOOST_URL_SOURCE msvc-14.0:no gcc-7:"-Wno-maybe-uninitialized" # variant2 - : usage-requirements + : common-requirements shared:BOOST_URL_DYN_LINK=1 static:BOOST_URL_STATIC_LINK=1 : source-location ../src ; alias url_sources - : src.cpp + : [ glob-tree-ex ../src : *.cpp ] ; explicit url_sources ; diff --git a/doc/qbk/1.0.overview.qbk b/doc/qbk/1.0.overview.qbk index 44db1ee8..1d710a13 100644 --- a/doc/qbk/1.0.overview.qbk +++ b/doc/qbk/1.0.overview.qbk @@ -49,7 +49,6 @@ Boost.URL offers these features: * Containers that maintain valid URLs * Parsing algorithms that work without exceptions * Control over storage and allocation for URLs -* Optionally header-only library, without linking * Support for `-fno-exceptions`, detected automatically * Features that work well on embedded devices @@ -69,19 +68,6 @@ The library requires a compiler supporting at least C++11. Aliases for standard types, such as __error_code__ or __string_view__, use their Boost equivalents. -[heading Header-Only] - -To use the library as header-only; that is, to eliminate the requirement -to link a program to a static or dynamic Boost.URL library, simply place -the following line in [*exactly one] source file in your project. - -[c++] -``` - #include -``` - -[heading Embedded] - Boost.URL works great on embedded devices. It can be used in a way that avoids all dynamic memory allocations. Furthermore it offers alternative interfaces that work without exceptions if diff --git a/doc/qbk/2.0.quicklook.qbk b/doc/qbk/2.0.quicklook.qbk index 7d91b1bc..c9f2fee1 100644 --- a/doc/qbk/2.0.quicklook.qbk +++ b/doc/qbk/2.0.quicklook.qbk @@ -22,8 +22,6 @@ and interface style of the library. [snippet_headers_3] ] -[h4 Compiled library] - We begin by including the library header file which brings all the symbols into scope. @@ -33,38 +31,12 @@ scope. Alternatively, individual headers may be included to obtain the declarations for specific types. -You need to link your program with the Boost.URL built library. You must install binaries -in a location that can be found by your linker. +Boost.URL is a compiled library. You need to link your program with the Boost.URL built library. +You must install binaries in a location that can be found by your linker. If you followed the [@http://www.boost.org/doc/libs/release/more/getting_started/index.html Boost Getting Started] instructions, that's already been done for you. -[h4 Header-only] - -To use Boost.URL as header-only; that is, to eliminate the requirement to link -a program to a static or dynamic Boost.URL library, place the following line -in [*exactly one] new or existing source file in your project. - -[c++] -``` - // In exactly *one* source file - #include -``` - -Then define `BOOST_URL_NO_LIB` and include the library headers in any file that -might uses Boost.URL. - -[c++] -``` - // In any other source file - #define BOOST_URL_NO_LIB - #include -``` - -This "header-only" configuration needs `BOOST_URL_NO_LIB` defined when building -with compilers supporting auto-linking, such as Microsoft Visual C++. The macro -instructs Boost to deactivate auto-linking. - [h3 Parsing] Say you have the following URL that you want to parse: diff --git a/example/Jamfile b/example/Jamfile index 89869369..e7050550 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -13,4 +13,4 @@ build-project suffix_list ; build-project mailto ; build-project magnet ; build-project file_router ; -build-project router ; +# build-project router ; diff --git a/example/router/CMakeLists.txt b/example/router/CMakeLists.txt index bbcd8a2d..43db0db8 100644 --- a/example/router/CMakeLists.txt +++ b/example/router/CMakeLists.txt @@ -7,13 +7,8 @@ # Official repository: https://github.com/boostorg/url # -source_group("" FILES - router.cpp - ) - -add_executable(router - router.cpp - ) +add_executable(router router.cpp impl/matches.cpp detail/impl/router.cpp) +target_link_libraries(router PRIVATE Boost::url Boost::beast) +source_group("" FILES router.cpp) set_property(TARGET router PROPERTY FOLDER "Examples") -target_link_libraries(router PRIVATE Boost::url Boost::beast) \ No newline at end of file diff --git a/example/router/Jamfile b/example/router/Jamfile index 81016bcf..86f02efd 100644 --- a/example/router/Jamfile +++ b/example/router/Jamfile @@ -18,4 +18,4 @@ project gcc-7:"-Wno-maybe-uninitialized" ; -exe router : router.cpp ; +exe router : router.cpp impl/matches.cpp detail/impl/router.cpp ; diff --git a/example/router/detail/impl/router.ipp b/example/router/detail/impl/router.cpp similarity index 99% rename from example/router/detail/impl/router.ipp rename to example/router/detail/impl/router.cpp index 031b8b78..ba1e77dc 100644 --- a/example/router/detail/impl/router.ipp +++ b/example/router/detail/impl/router.cpp @@ -11,6 +11,7 @@ #define BOOST_URL_DETAIL_ROUTER_IPP #include "../router.hpp" +#include #include #include #include diff --git a/example/router/detail/router.hpp b/example/router/detail/router.hpp index a6fb5d1c..79b31ece 100644 --- a/example/router/detail/router.hpp +++ b/example/router/detail/router.hpp @@ -11,6 +11,7 @@ #define BOOST_URL_DETAIL_ROUTER_HPP #include +#include #include #include #include diff --git a/example/router/impl/matches.ipp b/example/router/impl/matches.cpp similarity index 100% rename from example/router/impl/matches.ipp rename to example/router/impl/matches.cpp diff --git a/example/router/matches.hpp b/example/router/matches.hpp index bcc5b12c..f689fa5b 100644 --- a/example/router/matches.hpp +++ b/example/router/matches.hpp @@ -11,6 +11,7 @@ #define BOOST_URL_MATCHES_HPP #include +#include namespace boost { namespace urls { diff --git a/example/router/router.cpp b/example/router/router.cpp index 5041ee51..9fa54239 100644 --- a/example/router/router.cpp +++ b/example/router/router.cpp @@ -20,7 +20,6 @@ #endif #include "router.hpp" -#include "src.hpp" #include #include diff --git a/example/router/src.hpp b/example/router/src.hpp deleted file mode 100644 index 3f2935f9..00000000 --- a/example/router/src.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/url -// - -#ifndef BOOST_URL_ROUTER_SRC_HPP -#define BOOST_URL_ROUTER_SRC_HPP - -#ifndef BOOST_URL_SOURCE -#define BOOST_URL_SOURCE -#endif - -// include in one and no more than one source file -#include "detail/impl/router.ipp" -#include "impl/matches.ipp" - -#endif - diff --git a/include/boost/url/detail/impl/path.ipp b/include/boost/url/detail/impl/path.ipp deleted file mode 100644 index 916bfa70..00000000 --- a/include/boost/url/detail/impl/path.ipp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/url -// - -#ifndef BOOST_URL_DETAIL_IMPL_PATH_IPP -#define BOOST_URL_DETAIL_IMPL_PATH_IPP - -#include - -namespace boost { -namespace urls { -namespace detail { - -} // detail -} // url -} // boost - -#endif \ No newline at end of file diff --git a/include/boost/url/detail/normalize.hpp b/include/boost/url/detail/normalize.hpp index caf04745..0cc436af 100644 --- a/include/boost/url/detail/normalize.hpp +++ b/include/boost/url/detail/normalize.hpp @@ -12,6 +12,8 @@ #define BOOST_URL_DETAIL_NORMALIZED_HPP #include +#include +#include namespace boost { namespace urls { diff --git a/include/boost/url/detail/print.hpp b/include/boost/url/detail/print.hpp index 89a07829..6074ccd3 100644 --- a/include/boost/url/detail/print.hpp +++ b/include/boost/url/detail/print.hpp @@ -10,10 +10,6 @@ #ifndef BOOST_URL_DETAIL_PRINT_HPP #define BOOST_URL_DETAIL_PRINT_HPP -#ifndef BOOST_URL_SOURCE -#error -#endif - #include #include diff --git a/include/boost/url/grammar/detail/impl/ci_string.ipp b/include/boost/url/grammar/detail/impl/ci_string.ipp deleted file mode 100644 index 4854acf8..00000000 --- a/include/boost/url/grammar/detail/impl/ci_string.ipp +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/url -// - -#ifndef BOOST_URL_GRAMMAR_DETAIL_IMPL_CI_STRING_IPP -#define BOOST_URL_GRAMMAR_DETAIL_IMPL_CI_STRING_IPP - -#include - -namespace boost { -namespace urls { -namespace grammar { -namespace detail { - -//------------------------------------------------ - -// https://lemire.me/blog/2020/04/30/for-case-insensitive-string-comparisons-avoid-char-by-char-functions/ -// https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2020/04/30/tolower.cpp - -bool -ci_is_equal( - string_view s0, - string_view s1) noexcept -{ - auto n = s0.size(); - auto p1 = s0.data(); - auto p2 = s1.data(); - char a, b; - // fast loop - while(n--) - { - a = *p1++; - b = *p2++; - if(a != b) - goto slow; - } - return true; -slow: - do - { - if( to_lower(a) != - to_lower(b)) - return false; - a = *p1++; - b = *p2++; - } - while(n--); - return true; -} - -//------------------------------------------------ - -bool -ci_is_less( - string_view s0, - string_view s1) noexcept -{ - auto p1 = s0.data(); - auto p2 = s1.data(); - for(auto n = s0.size();n--;) - { - auto c1 = to_lower(*p1++); - auto c2 = to_lower(*p2++); - if(c1 != c2) - return c1 < c2; - } - // equal - return false; -} - -} // detail -} // grammar -} // urls -} // boost - -#endif diff --git a/include/boost/url/grammar/impl/error.hpp b/include/boost/url/grammar/impl/error.hpp index ef8dec00..a66efcc1 100644 --- a/include/boost/url/grammar/impl/error.hpp +++ b/include/boost/url/grammar/impl/error.hpp @@ -72,6 +72,12 @@ struct BOOST_SYMBOL_VISIBLE } }; +BOOST_URL_DECL extern + error_cat_type error_cat; + +BOOST_URL_DECL extern + condition_cat_type condition_cat; + } // detail inline @@ -79,11 +85,10 @@ system::error_code make_error_code( error ev) noexcept { - static BOOST_SYSTEM_CONSTEXPR - detail::error_cat_type cat{}; return system::error_code{ static_cast::type>(ev), cat}; + error>::type>(ev), + detail::error_cat}; } inline @@ -91,11 +96,10 @@ system::error_condition make_error_condition( condition c) noexcept { - static BOOST_SYSTEM_CONSTEXPR - detail::condition_cat_type cat{}; return system::error_condition{ static_cast::type>(c), cat}; + condition>::type>(c), + detail::condition_cat}; } } // grammar diff --git a/include/boost/url/rfc/detail/reg_name_rule.hpp b/include/boost/url/rfc/detail/reg_name_rule.hpp index 53d514ab..2f552b89 100644 --- a/include/boost/url/rfc/detail/reg_name_rule.hpp +++ b/include/boost/url/rfc/detail/reg_name_rule.hpp @@ -12,6 +12,7 @@ #include #include +#include #include namespace boost { diff --git a/include/boost/url/src.hpp b/include/boost/url/src.hpp deleted file mode 100644 index 643798f7..00000000 --- a/include/boost/url/src.hpp +++ /dev/null @@ -1,120 +0,0 @@ -// -// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) -// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/url -// - -#ifndef BOOST_URL_SRC_HPP -#define BOOST_URL_SRC_HPP - -/* - -This file is meant to be included once, -in a translation unit of the program. - -*/ - -// MUST COME FIRST -#ifndef BOOST_URL_SOURCE -#define BOOST_URL_SOURCE -#endif - -// We include this in case someone is -// using src.hpp as their main header file -#include - -//------------------------------------------------ -// -// url -// -//------------------------------------------------ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//------------------------------------------------ -// -// grammar -// -//------------------------------------------------ - -#include - -#include -#include -#include -#include -#include -#include - -//------------------------------------------------ -// -// rfc -// -//------------------------------------------------ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#endif diff --git a/include/boost/url/impl/authority_view.ipp b/src/authority_view.cpp similarity index 99% rename from include/boost/url/impl/authority_view.ipp rename to src/authority_view.cpp index 4bdfae4d..dbba4adc 100644 --- a/include/boost/url/impl/authority_view.ipp +++ b/src/authority_view.cpp @@ -10,7 +10,9 @@ #ifndef BOOST_URL_IMPL_AUTHORITY_VIEW_IPP #define BOOST_URL_IMPL_AUTHORITY_VIEW_IPP +#include #include +#include #include #include #include diff --git a/include/boost/url/impl/decode_view.ipp b/src/decode_view.cpp similarity index 97% rename from include/boost/url/impl/decode_view.ipp rename to src/decode_view.cpp index 11f3411a..aa624749 100644 --- a/include/boost/url/impl/decode_view.ipp +++ b/src/decode_view.cpp @@ -10,7 +10,9 @@ #ifndef BOOST_URL_IMPL_DECODE_VIEW_IPP #define BOOST_URL_IMPL_DECODE_VIEW_IPP +#include #include +#include #include namespace boost { diff --git a/include/boost/url/detail/impl/any_params_iter.ipp b/src/detail/any_params_iter.cpp similarity index 99% rename from include/boost/url/detail/impl/any_params_iter.ipp rename to src/detail/any_params_iter.cpp index d2ecab66..fb694528 100644 --- a/include/boost/url/detail/impl/any_params_iter.ipp +++ b/src/detail/any_params_iter.cpp @@ -10,7 +10,9 @@ #ifndef BOOST_URL_DETAIL_IMPL_ANY_PARAMS_ITER_IPP #define BOOST_URL_DETAIL_IMPL_ANY_PARAMS_ITER_IPP +#include #include +#include #include #include diff --git a/include/boost/url/detail/impl/any_segments_iter.ipp b/src/detail/any_segments_iter.cpp similarity index 97% rename from include/boost/url/detail/impl/any_segments_iter.ipp rename to src/detail/any_segments_iter.cpp index 1ad8405c..70368dc1 100644 --- a/include/boost/url/detail/impl/any_segments_iter.ipp +++ b/src/detail/any_segments_iter.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_DETAIL_IMPL_ANY_SEGMENTS_ITER_IPP #define BOOST_URL_DETAIL_IMPL_ANY_SEGMENTS_ITER_IPP +#include +#include #include #include #include diff --git a/include/boost/url/detail/impl/decode.ipp b/src/detail/decode.cpp similarity index 97% rename from include/boost/url/detail/impl/decode.ipp rename to src/detail/decode.cpp index 0acd2f19..7170ed4e 100644 --- a/include/boost/url/detail/impl/decode.ipp +++ b/src/detail/decode.cpp @@ -10,8 +10,10 @@ #ifndef BOOST_URL_DETAIL_IMPL_DECODE_IPP #define BOOST_URL_DETAIL_IMPL_DECODE_IPP +#include #include #include +#include #include namespace boost { diff --git a/include/boost/url/detail/impl/except.ipp b/src/detail/except.cpp similarity index 96% rename from include/boost/url/detail/impl/except.ipp rename to src/detail/except.cpp index 89bc088b..a7028542 100644 --- a/include/boost/url/detail/impl/except.ipp +++ b/src/detail/except.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_DETAIL_IMPL_EXCEPT_IPP #define BOOST_URL_DETAIL_IMPL_EXCEPT_IPP +#include #include #include #include diff --git a/include/boost/url/detail/impl/format_args.ipp b/src/detail/format_args.cpp similarity index 98% rename from include/boost/url/detail/impl/format_args.ipp rename to src/detail/format_args.cpp index 3e7fb143..e16773c3 100644 --- a/include/boost/url/detail/impl/format_args.ipp +++ b/src/detail/format_args.cpp @@ -10,9 +10,14 @@ #ifndef BOOST_URL_DETAIL_IMPL_FORMAT_ARGS_IPP #define BOOST_URL_DETAIL_IMPL_FORMAT_ARGS_IPP +#include +#include #include #include +#include +#include #include +#include #include namespace boost { diff --git a/include/boost/url/detail/impl/normalize.ipp b/src/detail/normalize.cpp similarity index 99% rename from include/boost/url/detail/impl/normalize.ipp rename to src/detail/normalize.cpp index b23dcad2..04ab0fca 100644 --- a/include/boost/url/detail/impl/normalize.ipp +++ b/src/detail/normalize.cpp @@ -11,9 +11,14 @@ #ifndef BOOST_URL_DETAIL_IMPL_NORMALIZE_IPP #define BOOST_URL_DETAIL_IMPL_NORMALIZE_IPP -#include +#include +#include +#include #include +#include +#include #include +#include #include namespace boost { diff --git a/include/boost/url/detail/impl/params_iter_impl.ipp b/src/detail/params_iter_impl.cpp similarity index 99% rename from include/boost/url/detail/impl/params_iter_impl.ipp rename to src/detail/params_iter_impl.cpp index 1da1929d..951a3214 100644 --- a/include/boost/url/detail/impl/params_iter_impl.ipp +++ b/src/detail/params_iter_impl.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_DETAIL_IMPL_PARAMS_ITER_IMPL_IPP #define BOOST_URL_DETAIL_IMPL_PARAMS_ITER_IMPL_IPP +#include #include #include diff --git a/include/boost/url/detail/impl/pattern.ipp b/src/detail/pattern.cpp similarity index 99% rename from include/boost/url/detail/impl/pattern.ipp rename to src/detail/pattern.cpp index a872d9a3..f06990b9 100644 --- a/include/boost/url/detail/impl/pattern.ipp +++ b/src/detail/pattern.cpp @@ -10,9 +10,14 @@ #ifndef BOOST_URL_DETAIL_IMPL_PATTERN_IPP #define BOOST_URL_DETAIL_IMPL_PATTERN_IPP +#include #include #include #include +#include +#include +#include +#include #include #include #include diff --git a/include/boost/url/detail/impl/pct_format.ipp b/src/detail/pct_format.cpp similarity index 98% rename from include/boost/url/detail/impl/pct_format.ipp rename to src/detail/pct_format.cpp index 7bb1ed7a..62a4475a 100644 --- a/include/boost/url/detail/impl/pct_format.ipp +++ b/src/detail/pct_format.cpp @@ -10,7 +10,9 @@ #ifndef BOOST_URL_DETAIL_IMPL_PCT_FORMAT_IPP #define BOOST_URL_DETAIL_IMPL_PCT_FORMAT_IPP +#include #include +#include #include namespace boost { diff --git a/include/boost/url/detail/impl/replacement_field_rule.ipp b/src/detail/replacement_field_rule.cpp similarity index 97% rename from include/boost/url/detail/impl/replacement_field_rule.ipp rename to src/detail/replacement_field_rule.cpp index 265a8a63..983b7e8c 100644 --- a/include/boost/url/detail/impl/replacement_field_rule.ipp +++ b/src/detail/replacement_field_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_DETAIL_IMPL_REPLACEMENT_FIELD_RULE_IPP #define BOOST_URL_DETAIL_IMPL_REPLACEMENT_FIELD_RULE_IPP +#include #include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include namespace boost { namespace urls { diff --git a/include/boost/url/detail/impl/segments_iter_impl.ipp b/src/detail/segments_iter_impl.cpp similarity index 97% rename from include/boost/url/detail/impl/segments_iter_impl.ipp rename to src/detail/segments_iter_impl.cpp index 551c6b28..6c23f1f2 100644 --- a/include/boost/url/detail/impl/segments_iter_impl.ipp +++ b/src/detail/segments_iter_impl.cpp @@ -11,6 +11,8 @@ #ifndef BOOST_URL_DETAIL_IMPL_SEGMENTS_ITER_IMPL_IPP #define BOOST_URL_DETAIL_IMPL_SEGMENTS_ITER_IMPL_IPP +#include +#include #include #include #include diff --git a/include/boost/url/detail/impl/url_impl.ipp b/src/detail/url_impl.cpp similarity index 98% rename from include/boost/url/detail/impl/url_impl.ipp rename to src/detail/url_impl.cpp index 447cc3b7..e4e87ccc 100644 --- a/include/boost/url/detail/impl/url_impl.ipp +++ b/src/detail/url_impl.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_DETAIL_IMPL_URL_IMPL_IPP #define BOOST_URL_DETAIL_IMPL_URL_IMPL_IPP +#include +#include #include #include #include diff --git a/include/boost/url/impl/error.ipp b/src/error.cpp similarity index 93% rename from include/boost/url/impl/error.ipp rename to src/error.cpp index 64f9e073..ef84853e 100644 --- a/include/boost/url/impl/error.ipp +++ b/src/error.cpp @@ -10,7 +10,9 @@ #ifndef BOOST_URL_IMPL_ERROR_IPP #define BOOST_URL_IMPL_ERROR_IPP +#include #include +#include namespace boost { namespace urls { @@ -67,7 +69,7 @@ default_error_condition( case error::bad_pct_hexdig: case error::incomplete_encoding: case error::missing_pct_hexdig: -return grammar::condition::fatal; + return grammar::condition::fatal; } } @@ -81,11 +83,7 @@ return grammar::condition::fatal; # pragma warning( disable : 4592 ) #endif -#if defined(__cpp_constinit) && __cpp_constinit >= 201907L -constinit error_cat_type error_cat; -#else error_cat_type error_cat; -#endif #if defined(_MSC_VER) && _MSC_VER <= 1900 # pragma warning( pop ) diff --git a/include/boost/url/grammar/impl/ci_string.ipp b/src/grammar/ci_string.cpp similarity index 98% rename from include/boost/url/grammar/impl/ci_string.ipp rename to src/grammar/ci_string.cpp index 484d230b..68b31d41 100644 --- a/include/boost/url/grammar/impl/ci_string.ipp +++ b/src/grammar/ci_string.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_GRAMMAR_IMPL_CI_STRING_IPP #define BOOST_URL_GRAMMAR_IMPL_CI_STRING_IPP +#include #include namespace boost { diff --git a/include/boost/url/grammar/impl/dec_octet_rule.ipp b/src/grammar/dec_octet_rule.cpp similarity index 93% rename from include/boost/url/grammar/impl/dec_octet_rule.ipp rename to src/grammar/dec_octet_rule.cpp index a4ae2d8d..be128c01 100644 --- a/include/boost/url/grammar/impl/dec_octet_rule.ipp +++ b/src/grammar/dec_octet_rule.cpp @@ -10,8 +10,11 @@ #ifndef BOOST_URL_IMPL_GRAMMAR_DEC_OCTET_RULE_IPP #define BOOST_URL_IMPL_GRAMMAR_DEC_OCTET_RULE_IPP -#include +#include #include +#include +#include +#include namespace boost { namespace urls { diff --git a/include/boost/url/grammar/impl/delim_rule.ipp b/src/grammar/delim_rule.cpp similarity index 92% rename from include/boost/url/grammar/impl/delim_rule.ipp rename to src/grammar/delim_rule.cpp index 4341a136..21b38b14 100644 --- a/include/boost/url/grammar/impl/delim_rule.ipp +++ b/src/grammar/delim_rule.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_GRAMMAR_IMPL_DELIM_RULE_IPP #define BOOST_URL_GRAMMAR_IMPL_DELIM_RULE_IPP +#include +#include #include namespace boost { diff --git a/include/boost/url/grammar/detail/impl/recycled.ipp b/src/grammar/detail/recycled.cpp similarity index 94% rename from include/boost/url/grammar/detail/impl/recycled.ipp rename to src/grammar/detail/recycled.cpp index 755d70e7..46d78657 100644 --- a/include/boost/url/grammar/detail/impl/recycled.ipp +++ b/src/grammar/detail/recycled.cpp @@ -7,9 +7,8 @@ // Official repository: https://github.com/boostorg/url // -#ifndef BOOST_URL_GRAMMAR_DETAIL_IMPL_RECYCLED_IPP -#define BOOST_URL_GRAMMAR_DETAIL_IMPL_RECYCLED_IPP - +#include +#include #include #include #include @@ -98,5 +97,3 @@ recycled_remove_impl( } // grammar } // urls } // boost - -#endif diff --git a/include/boost/url/grammar/impl/error.ipp b/src/grammar/error.cpp similarity index 79% rename from include/boost/url/grammar/impl/error.ipp rename to src/grammar/error.cpp index c3e4bde3..7840761a 100644 --- a/include/boost/url/grammar/impl/error.ipp +++ b/src/grammar/error.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_GRAMMAR_IMPL_ERROR_IPP #define BOOST_URL_GRAMMAR_IMPL_ERROR_IPP +#include #include namespace boost { @@ -95,6 +96,23 @@ message( } } +//----------------------------------------------- + +// msvc 14.0 has a bug that warns about inability +// to use constexpr construction here, even though +// there's no constexpr construction +#if defined(_MSC_VER) && _MSC_VER <= 1900 +# pragma warning( push ) +# pragma warning( disable : 4592 ) +#endif + +error_cat_type error_cat; +condition_cat_type condition_cat; + +#if defined(_MSC_VER) && _MSC_VER <= 1900 +# pragma warning( pop ) +#endif + } // detail } // grammar diff --git a/include/boost/url/grammar/impl/literal_rule.ipp b/src/grammar/literal_rule.cpp similarity index 94% rename from include/boost/url/grammar/impl/literal_rule.ipp rename to src/grammar/literal_rule.cpp index fb189270..75c797b7 100644 --- a/include/boost/url/grammar/impl/literal_rule.ipp +++ b/src/grammar/literal_rule.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_GRAMMAR_IMPL_LITERAL_RULE_IPP #define BOOST_URL_GRAMMAR_IMPL_LITERAL_RULE_IPP +#include +#include #include #include #include diff --git a/include/boost/url/grammar/impl/string_view_base.ipp b/src/grammar/string_view_base.cpp similarity index 94% rename from include/boost/url/grammar/impl/string_view_base.ipp rename to src/grammar/string_view_base.cpp index d10f17c0..d507d1b8 100644 --- a/include/boost/url/grammar/impl/string_view_base.ipp +++ b/src/grammar/string_view_base.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_IMPL_STRING_VIEW_BASE_IPP #define BOOST_URL_IMPL_STRING_VIEW_BASE_IPP +#include #include #include diff --git a/include/boost/url/impl/ipv4_address.ipp b/src/ipv4_address.cpp similarity index 97% rename from include/boost/url/impl/ipv4_address.ipp rename to src/ipv4_address.cpp index b5fab658..173866be 100644 --- a/include/boost/url/impl/ipv4_address.ipp +++ b/src/ipv4_address.cpp @@ -10,8 +10,10 @@ #ifndef BOOST_URL_IMPL_IPV4_ADDRESS_IPP #define BOOST_URL_IMPL_IPV4_ADDRESS_IPP +#include #include #include +#include #include #include diff --git a/include/boost/url/impl/ipv6_address.ipp b/src/ipv6_address.cpp similarity index 98% rename from include/boost/url/impl/ipv6_address.ipp rename to src/ipv6_address.cpp index 7892ebc8..61d53b5e 100644 --- a/include/boost/url/impl/ipv6_address.ipp +++ b/src/ipv6_address.cpp @@ -10,7 +10,9 @@ #ifndef BOOST_URL_IMPL_IPV6_ADDRESS_IPP #define BOOST_URL_IMPL_IPV6_ADDRESS_IPP +#include #include +#include #include #include #include diff --git a/include/boost/url/impl/params_base.ipp b/src/params_base.cpp similarity index 96% rename from include/boost/url/impl/params_base.ipp rename to src/params_base.cpp index 3615d2cc..67a949be 100644 --- a/include/boost/url/impl/params_base.ipp +++ b/src/params_base.cpp @@ -11,7 +11,10 @@ #ifndef BOOST_URL_IMPL_PARAMS_BASE_IPP #define BOOST_URL_IMPL_PARAMS_BASE_IPP +#include +#include #include +#include #include namespace boost { diff --git a/include/boost/url/impl/params_encoded_base.ipp b/src/params_encoded_base.cpp similarity index 96% rename from include/boost/url/impl/params_encoded_base.ipp rename to src/params_encoded_base.cpp index d8f665f5..e5bb0608 100644 --- a/include/boost/url/impl/params_encoded_base.ipp +++ b/src/params_encoded_base.cpp @@ -11,7 +11,10 @@ #ifndef BOOST_URL_IMPL_PARAMS_ENCODED_BASE_IPP #define BOOST_URL_IMPL_PARAMS_ENCODED_BASE_IPP +#include +#include #include +#include #include namespace boost { diff --git a/include/boost/url/impl/params_encoded_ref.ipp b/src/params_encoded_ref.cpp similarity index 98% rename from include/boost/url/impl/params_encoded_ref.ipp rename to src/params_encoded_ref.cpp index 225a38ee..710dd0c1 100644 --- a/include/boost/url/impl/params_encoded_ref.ipp +++ b/src/params_encoded_ref.cpp @@ -11,6 +11,8 @@ #ifndef BOOST_URL_IMPL_PARAMS_ENCODED_REF_IPP #define BOOST_URL_IMPL_PARAMS_ENCODED_REF_IPP +#include +#include #include #include #include diff --git a/include/boost/url/impl/params_encoded_view.ipp b/src/params_encoded_view.cpp similarity index 96% rename from include/boost/url/impl/params_encoded_view.ipp rename to src/params_encoded_view.cpp index da3089f4..e66fa9f5 100644 --- a/include/boost/url/impl/params_encoded_view.ipp +++ b/src/params_encoded_view.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_PARAMS_ENCODED_VIEW_IPP #define BOOST_URL_IMPL_PARAMS_ENCODED_VIEW_IPP +#include #include #include diff --git a/include/boost/url/impl/params_ref.ipp b/src/params_ref.cpp similarity index 98% rename from include/boost/url/impl/params_ref.ipp rename to src/params_ref.cpp index 209ff590..9473923e 100644 --- a/include/boost/url/impl/params_ref.ipp +++ b/src/params_ref.cpp @@ -11,6 +11,8 @@ #ifndef BOOST_URL_IMPL_PARAMS_REF_IPP #define BOOST_URL_IMPL_PARAMS_REF_IPP +#include +#include #include #include #include diff --git a/include/boost/url/impl/params_view.ipp b/src/params_view.cpp similarity index 96% rename from include/boost/url/impl/params_view.ipp rename to src/params_view.cpp index 7ee089d5..f4889207 100644 --- a/include/boost/url/impl/params_view.ipp +++ b/src/params_view.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_PARAMS_VIEW_IPP #define BOOST_URL_IMPL_PARAMS_VIEW_IPP +#include #include #include diff --git a/include/boost/url/impl/parse.ipp b/src/parse.cpp similarity index 97% rename from include/boost/url/impl/parse.ipp rename to src/parse.cpp index 25b5f266..04d6b438 100644 --- a/include/boost/url/impl/parse.ipp +++ b/src/parse.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_PARSE_IPP #define BOOST_URL_IMPL_PARSE_IPP +#include #include #include #include diff --git a/include/boost/url/impl/parse_path.ipp b/src/parse_path.cpp similarity index 97% rename from include/boost/url/impl/parse_path.ipp rename to src/parse_path.cpp index 2e4be984..055ee24f 100644 --- a/include/boost/url/impl/parse_path.ipp +++ b/src/parse_path.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_PARSE_PATH_IPP #define BOOST_URL_IMPL_PARSE_PATH_IPP +#include #include #include #include diff --git a/include/boost/url/impl/parse_query.ipp b/src/parse_query.cpp similarity index 96% rename from include/boost/url/impl/parse_query.ipp rename to src/parse_query.cpp index a140f78e..e0e44926 100644 --- a/include/boost/url/impl/parse_query.ipp +++ b/src/parse_query.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_PARSE_QUERY_IPP #define BOOST_URL_IMPL_PARSE_QUERY_IPP +#include #include #include #include diff --git a/include/boost/url/impl/pct_string_view.ipp b/src/pct_string_view.cpp similarity index 96% rename from include/boost/url/impl/pct_string_view.ipp rename to src/pct_string_view.cpp index 739f687c..adbbfe92 100644 --- a/include/boost/url/impl/pct_string_view.ipp +++ b/src/pct_string_view.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_IMPL_PCT_STRING_VIEW_IPP #define BOOST_URL_IMPL_PCT_STRING_VIEW_IPP +#include +#include #include #include #include diff --git a/include/boost/url/rfc/impl/absolute_uri_rule.ipp b/src/rfc/absolute_uri_rule.cpp similarity index 98% rename from include/boost/url/rfc/impl/absolute_uri_rule.ipp rename to src/rfc/absolute_uri_rule.cpp index 660f9562..2878ac71 100644 --- a/include/boost/url/rfc/impl/absolute_uri_rule.ipp +++ b/src/rfc/absolute_uri_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_RFC_IMPL_ABSOLUTE_URI_RULE_IPP #define BOOST_URL_RFC_IMPL_ABSOLUTE_URI_RULE_IPP +#include #include #include #include diff --git a/include/boost/url/rfc/impl/authority_rule.ipp b/src/rfc/authority_rule.cpp similarity index 95% rename from include/boost/url/rfc/impl/authority_rule.ipp rename to src/rfc/authority_rule.cpp index ee9e977b..ba3d8617 100644 --- a/include/boost/url/rfc/impl/authority_rule.ipp +++ b/src/rfc/authority_rule.cpp @@ -10,8 +10,10 @@ #ifndef BOOST_URL_RFC_IMPL_AUTHORITY_RULE_IPP #define BOOST_URL_RFC_IMPL_AUTHORITY_RULE_IPP +#include #include #include +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/h16_rule.ipp b/src/rfc/detail/h16_rule.cpp similarity index 95% rename from include/boost/url/rfc/detail/impl/h16_rule.ipp rename to src/rfc/detail/h16_rule.cpp index d1954cf2..d135d00b 100644 --- a/include/boost/url/rfc/detail/impl/h16_rule.ipp +++ b/src/rfc/detail/h16_rule.cpp @@ -10,9 +10,11 @@ #ifndef BOOST_URL_RFC_DETAIL_IMPL_H16_RULE_HPP #define BOOST_URL_RFC_DETAIL_IMPL_H16_RULE_HPP +#include #include #include #include +#include #include namespace boost { diff --git a/include/boost/url/rfc/detail/impl/hier_part_rule.ipp b/src/rfc/detail/hier_part_rule.cpp similarity index 98% rename from include/boost/url/rfc/detail/impl/hier_part_rule.ipp rename to src/rfc/detail/hier_part_rule.cpp index 8dd0cbab..cec014c1 100644 --- a/include/boost/url/rfc/detail/impl/hier_part_rule.ipp +++ b/src/rfc/detail/hier_part_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_RFC_DETAIL_IMPL_HIER_PART_RULE_IPP #define BOOST_URL_RFC_DETAIL_IMPL_HIER_PART_RULE_IPP +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/host_rule.ipp b/src/rfc/detail/host_rule.cpp similarity index 97% rename from include/boost/url/rfc/detail/impl/host_rule.ipp rename to src/rfc/detail/host_rule.cpp index 1713992d..5c6d4aa8 100644 --- a/include/boost/url/rfc/detail/impl/host_rule.ipp +++ b/src/rfc/detail/host_rule.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_RFC_DETAIL_IMPL_HOST_RULE_IPP #define BOOST_URL_RFC_DETAIL_IMPL_HOST_RULE_IPP +#include +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/ip_literal_rule.ipp b/src/rfc/detail/ip_literal_rule.cpp similarity index 95% rename from include/boost/url/rfc/detail/impl/ip_literal_rule.ipp rename to src/rfc/detail/ip_literal_rule.cpp index 3bef6868..6fc0c4fd 100644 --- a/include/boost/url/rfc/detail/impl/ip_literal_rule.ipp +++ b/src/rfc/detail/ip_literal_rule.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_IMPL_IP_LITERAL_RULE_IPP #define BOOST_URL_IMPL_IP_LITERAL_RULE_IPP +#include +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/ipvfuture_rule.ipp b/src/rfc/detail/ipvfuture_rule.cpp similarity index 95% rename from include/boost/url/rfc/detail/impl/ipvfuture_rule.ipp rename to src/rfc/detail/ipvfuture_rule.cpp index 2ed99d2c..82cd248a 100644 --- a/include/boost/url/rfc/detail/impl/ipvfuture_rule.ipp +++ b/src/rfc/detail/ipvfuture_rule.cpp @@ -10,11 +10,13 @@ #ifndef BOOST_URL_DETAIL_IMPL_IPVFUTURE_RULE_IPP #define BOOST_URL_DETAIL_IMPL_IPVFUTURE_RULE_IPP +#include #include #include #include #include #include +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/port_rule.ipp b/src/rfc/detail/port_rule.cpp similarity index 98% rename from include/boost/url/rfc/detail/impl/port_rule.ipp rename to src/rfc/detail/port_rule.cpp index 5d2aaba3..a13f1bdd 100644 --- a/include/boost/url/rfc/detail/impl/port_rule.ipp +++ b/src/rfc/detail/port_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_IMPL_PORT_RULE_IPP #define BOOST_URL_IMPL_PORT_RULE_IPP +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/relative_part_rule.ipp b/src/rfc/detail/relative_part_rule.cpp similarity index 98% rename from include/boost/url/rfc/detail/impl/relative_part_rule.ipp rename to src/rfc/detail/relative_part_rule.cpp index e99f865c..1606ebc4 100644 --- a/include/boost/url/rfc/detail/impl/relative_part_rule.ipp +++ b/src/rfc/detail/relative_part_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_RFC_DETAIL_IMPL_RELATIVE_PART_RULE_IPP #define BOOST_URL_RFC_DETAIL_IMPL_RELATIVE_PART_RULE_IPP +#include #include #include #include diff --git a/include/boost/url/rfc/detail/impl/scheme_rule.ipp b/src/rfc/detail/scheme_rule.cpp similarity index 91% rename from include/boost/url/rfc/detail/impl/scheme_rule.ipp rename to src/rfc/detail/scheme_rule.cpp index 3088c588..9efcda42 100644 --- a/include/boost/url/rfc/detail/impl/scheme_rule.ipp +++ b/src/rfc/detail/scheme_rule.cpp @@ -10,10 +10,13 @@ #ifndef BOOST_URL_IMPL_SCHEME_RULE_IPP #define BOOST_URL_IMPL_SCHEME_RULE_IPP +#include #include +#include #include -#include +#include #include +#include namespace boost { namespace urls { diff --git a/include/boost/url/rfc/detail/impl/userinfo_rule.ipp b/src/rfc/detail/userinfo_rule.cpp similarity index 92% rename from include/boost/url/rfc/detail/impl/userinfo_rule.ipp rename to src/rfc/detail/userinfo_rule.cpp index b8a8ee47..502d41c0 100644 --- a/include/boost/url/rfc/detail/impl/userinfo_rule.ipp +++ b/src/rfc/detail/userinfo_rule.cpp @@ -10,9 +10,12 @@ #ifndef BOOST_URL_RFC_DETAIL_IMPL_USERINFO_RULE_IPP #define BOOST_URL_RFC_DETAIL_IMPL_USERINFO_RULE_IPP +#include #include #include #include +#include +#include #include namespace boost { diff --git a/include/boost/url/rfc/impl/ipv4_address_rule.ipp b/src/rfc/ipv4_address_rule.cpp similarity index 97% rename from include/boost/url/rfc/impl/ipv4_address_rule.ipp rename to src/rfc/ipv4_address_rule.cpp index 17f49338..92f211b0 100644 --- a/include/boost/url/rfc/impl/ipv4_address_rule.ipp +++ b/src/rfc/ipv4_address_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_RFC_IMPL_IPV4_ADDRESS_RULE_IPP #define BOOST_URL_RFC_IMPL_IPV4_ADDRESS_RULE_IPP +#include #include #include #include diff --git a/include/boost/url/rfc/impl/ipv6_address_rule.ipp b/src/rfc/ipv6_address_rule.cpp similarity index 98% rename from include/boost/url/rfc/impl/ipv6_address_rule.ipp rename to src/rfc/ipv6_address_rule.cpp index c8746603..c153a0b7 100644 --- a/include/boost/url/rfc/impl/ipv6_address_rule.ipp +++ b/src/rfc/ipv6_address_rule.cpp @@ -10,10 +10,12 @@ #ifndef BOOST_URL_RFC_IMPL_IPV6_ADDRESS_RULE_IPP #define BOOST_URL_RFC_IMPL_IPV6_ADDRESS_RULE_IPP +#include #include #include #include #include +#include #include #include #include diff --git a/include/boost/url/rfc/impl/origin_form_rule.ipp b/src/rfc/origin_form_rule.cpp similarity index 94% rename from include/boost/url/rfc/impl/origin_form_rule.ipp rename to src/rfc/origin_form_rule.cpp index 211afcc8..d4f38922 100644 --- a/include/boost/url/rfc/impl/origin_form_rule.ipp +++ b/src/rfc/origin_form_rule.cpp @@ -10,9 +10,11 @@ #ifndef BOOST_URL_RFC_IMPL_ORIGIN_FORM_RULE_IPP #define BOOST_URL_RFC_IMPL_ORIGIN_FORM_RULE_IPP +#include #include #include #include +#include #include #include #include diff --git a/include/boost/url/rfc/impl/query_rule.ipp b/src/rfc/query_rule.cpp similarity index 98% rename from include/boost/url/rfc/impl/query_rule.ipp rename to src/rfc/query_rule.cpp index 80f368e3..90871f4e 100644 --- a/include/boost/url/rfc/impl/query_rule.ipp +++ b/src/rfc/query_rule.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_RFC_IMPL_QUERY_RULE_IPP #define BOOST_URL_RFC_IMPL_QUERY_RULE_IPP +#include #include #include #include diff --git a/include/boost/url/rfc/impl/relative_ref_rule.ipp b/src/rfc/relative_ref_rule.cpp similarity index 95% rename from include/boost/url/rfc/impl/relative_ref_rule.ipp rename to src/rfc/relative_ref_rule.cpp index c3437513..58ca0e02 100644 --- a/include/boost/url/rfc/impl/relative_ref_rule.ipp +++ b/src/rfc/relative_ref_rule.cpp @@ -10,9 +10,11 @@ #ifndef BOOST_URL_RFC_IMPL_RELATIVE_REF_RULE_IPP #define BOOST_URL_RFC_IMPL_RELATIVE_REF_RULE_IPP +#include #include #include #include +#include #include #include #include diff --git a/include/boost/url/rfc/impl/uri_reference_rule.ipp b/src/rfc/uri_reference_rule.cpp similarity index 86% rename from include/boost/url/rfc/impl/uri_reference_rule.ipp rename to src/rfc/uri_reference_rule.cpp index ffd94335..915386cb 100644 --- a/include/boost/url/rfc/impl/uri_reference_rule.ipp +++ b/src/rfc/uri_reference_rule.cpp @@ -10,11 +10,13 @@ #ifndef BOOST_URL_RFC_IMPL_URI_REFERENCE_RULE_IPP #define BOOST_URL_RFC_IMPL_URI_REFERENCE_RULE_IPP +#include #include #include #include #include #include +#include namespace boost { namespace urls { @@ -38,9 +40,9 @@ parse( { default: case 0: - return get<0>(*rv); + return boost::variant2::get<0>(*rv); case 1: - return get<1>(*rv); + return boost::variant2::get<1>(*rv); } } diff --git a/include/boost/url/rfc/impl/uri_rule.ipp b/src/rfc/uri_rule.cpp similarity index 96% rename from include/boost/url/rfc/impl/uri_rule.ipp rename to src/rfc/uri_rule.cpp index f1b36320..a9620327 100644 --- a/include/boost/url/rfc/impl/uri_rule.ipp +++ b/src/rfc/uri_rule.cpp @@ -10,10 +10,12 @@ #ifndef BOOST_URL_RFC_IMPL_URI_RULE_IPP #define BOOST_URL_RFC_IMPL_URI_RULE_IPP +#include #include #include #include #include +#include #include #include #include diff --git a/include/boost/url/impl/scheme.ipp b/src/scheme.cpp similarity index 98% rename from include/boost/url/impl/scheme.ipp rename to src/scheme.cpp index eb8d7786..6ebb7a2d 100644 --- a/include/boost/url/impl/scheme.ipp +++ b/src/scheme.cpp @@ -10,6 +10,7 @@ #ifndef BOOST_URL_IMPL_SCHEME_IPP #define BOOST_URL_IMPL_SCHEME_IPP +#include #include #include diff --git a/include/boost/url/impl/segments_base.ipp b/src/segments_base.cpp similarity index 97% rename from include/boost/url/impl/segments_base.ipp rename to src/segments_base.cpp index 9a1ab983..3693f37e 100644 --- a/include/boost/url/impl/segments_base.ipp +++ b/src/segments_base.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_SEGMENTS_BASE_IPP #define BOOST_URL_IMPL_SEGMENTS_BASE_IPP +#include #include #include diff --git a/include/boost/url/impl/segments_encoded_base.ipp b/src/segments_encoded_base.cpp similarity index 98% rename from include/boost/url/impl/segments_encoded_base.ipp rename to src/segments_encoded_base.cpp index 136b9f3f..8a6436e5 100644 --- a/include/boost/url/impl/segments_encoded_base.ipp +++ b/src/segments_encoded_base.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_SEGMENTS_ENCODED_BASE_IPP #define BOOST_URL_IMPL_SEGMENTS_ENCODED_BASE_IPP +#include #include #include #include diff --git a/include/boost/url/impl/segments_encoded_ref.ipp b/src/segments_encoded_ref.cpp similarity index 98% rename from include/boost/url/impl/segments_encoded_ref.ipp rename to src/segments_encoded_ref.cpp index 6a992987..01f8b539 100644 --- a/include/boost/url/impl/segments_encoded_ref.ipp +++ b/src/segments_encoded_ref.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_SEGMENTS_ENCODED_REF_IPP #define BOOST_URL_IMPL_SEGMENTS_ENCODED_REF_IPP +#include #include #include #include diff --git a/include/boost/url/impl/segments_encoded_view.ipp b/src/segments_encoded_view.cpp similarity index 96% rename from include/boost/url/impl/segments_encoded_view.ipp rename to src/segments_encoded_view.cpp index 510a35a5..0dfe3b62 100644 --- a/include/boost/url/impl/segments_encoded_view.ipp +++ b/src/segments_encoded_view.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_SEGMENTS_ENCODED_VIEW_IPP #define BOOST_URL_IMPL_SEGMENTS_ENCODED_VIEW_IPP +#include #include #include diff --git a/include/boost/url/impl/segments_ref.ipp b/src/segments_ref.cpp similarity index 98% rename from include/boost/url/impl/segments_ref.ipp rename to src/segments_ref.cpp index cf20ccad..24951456 100644 --- a/include/boost/url/impl/segments_ref.ipp +++ b/src/segments_ref.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_SEGMENTS_REF_IPP #define BOOST_URL_IMPL_SEGMENTS_REF_IPP +#include #include #include #include diff --git a/include/boost/url/impl/segments_view.ipp b/src/segments_view.cpp similarity index 95% rename from include/boost/url/impl/segments_view.ipp rename to src/segments_view.cpp index a243efda..20169e45 100644 --- a/include/boost/url/impl/segments_view.ipp +++ b/src/segments_view.cpp @@ -11,6 +11,7 @@ #ifndef BOOST_URL_IMPL_SEGMENTS_VIEW_IPP #define BOOST_URL_IMPL_SEGMENTS_VIEW_IPP +#include #include #include diff --git a/src/src.cpp b/src/src.cpp deleted file mode 100644 index e48d83a0..00000000 --- a/src/src.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// -// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/boostorg/url -// - -#include diff --git a/include/boost/url/impl/static_url.ipp b/src/static_url.cpp similarity index 94% rename from include/boost/url/impl/static_url.ipp rename to src/static_url.cpp index 578356d9..abb29c4f 100644 --- a/include/boost/url/impl/static_url.ipp +++ b/src/static_url.cpp @@ -10,6 +10,8 @@ #ifndef BOOST_URL_IMPL_STATIC_URL_IPP #define BOOST_URL_IMPL_STATIC_URL_IPP +#include +#include #include #include #include diff --git a/include/boost/url/impl/url.ipp b/src/url.cpp similarity index 96% rename from include/boost/url/impl/url.ipp rename to src/url.cpp index 3d19b774..3a91a51e 100644 --- a/include/boost/url/impl/url.ipp +++ b/src/url.cpp @@ -11,7 +11,9 @@ #ifndef BOOST_URL_IMPL_URL_IPP #define BOOST_URL_IMPL_URL_IPP +#include #include +#include #include namespace boost { @@ -98,8 +100,7 @@ clear_impl() noexcept } else { - BOOST_ASSERT(impl_.cs_ == - detail::empty_c_str_); + BOOST_ASSERT(impl_.cs_[0] == 0); } } diff --git a/include/boost/url/impl/url_base.ipp b/src/url_base.cpp similarity index 99% rename from include/boost/url/impl/url_base.ipp rename to src/url_base.cpp index f4f94c97..40c30a4a 100644 --- a/include/boost/url/impl/url_base.ipp +++ b/src/url_base.cpp @@ -11,17 +11,23 @@ #ifndef BOOST_URL_IMPL_URL_BASE_IPP #define BOOST_URL_IMPL_URL_BASE_IPP +#include #include +#include #include #include #include #include #include #include +#include #include #include #include +#include +#include #include +#include #include #include #include diff --git a/include/boost/url/impl/url_view.ipp b/src/url_view.cpp similarity index 95% rename from include/boost/url/impl/url_view.ipp rename to src/url_view.cpp index 973664a4..5866a1fc 100644 --- a/include/boost/url/impl/url_view.ipp +++ b/src/url_view.cpp @@ -11,7 +11,9 @@ #ifndef BOOST_URL_IMPL_URL_VIEW_IPP #define BOOST_URL_IMPL_URL_VIEW_IPP +#include #include +#include #include namespace boost { diff --git a/include/boost/url/impl/url_view_base.ipp b/src/url_view_base.cpp similarity index 99% rename from include/boost/url/impl/url_view_base.ipp rename to src/url_view_base.cpp index 25cdf415..367d9dd0 100644 --- a/include/boost/url/impl/url_view_base.ipp +++ b/src/url_view_base.cpp @@ -11,8 +11,11 @@ #ifndef BOOST_URL_IMPL_URL_VIEW_BASE_IPP #define BOOST_URL_IMPL_URL_VIEW_BASE_IPP +#include #include +#include #include +#include #include namespace boost { diff --git a/test/limits/CMakeLists.txt b/test/limits/CMakeLists.txt index f88cb5ad..a4fccfab 100644 --- a/test/limits/CMakeLists.txt +++ b/test/limits/CMakeLists.txt @@ -11,13 +11,14 @@ set(SUITE_FILES ../../extra/test_main.cpp ../../extra/test_suite.hpp) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES limits.cpp Jamfile) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../extra PREFIX "_extra" FILES ${SUITE_FILES}) -source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../src PREFIX "_extra" FILES ../../src/src.cpp) -add_executable(boost_url_limits limits.cpp Jamfile ${SUITE_FILES} ../../src/src.cpp) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../src PREFIX "url" FILES ${BOOST_URL_SOURCES}) + +add_library(boost_url_small_limits ${BOOST_URL_HEADERS} ${BOOST_URL_SOURCES}) +boost_url_setup_properties(boost_url_small_limits) +target_compile_definitions(boost_url_small_limits PUBLIC BOOST_URL_MAX_SIZE=16 BOOST_URL_NO_LIB=1) + +add_executable(boost_url_limits limits.cpp Jamfile ${SUITE_FILES}) target_include_directories(boost_url_limits PRIVATE ../../include ../../extra ../../..) -target_compile_definitions(boost_url_limits PRIVATE - BOOST_URL_MAX_SIZE=16 - BOOST_URL_NO_LIB=1 -) if (BOOST_URL_FIND_PACKAGE_BOOST) target_link_libraries(boost_url_limits PRIVATE Boost::headers) else() @@ -30,6 +31,6 @@ else() Boost::system Boost::variant2) endif() -target_link_libraries(boost_url_limits INTERFACE Boost::url) +target_link_libraries(boost_url_limits PRIVATE boost_url_small_limits) add_test(NAME boost_url_limits COMMAND boost_url_limits) add_dependencies(boost_url_all_tests boost_url_limits) diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 64dc7556..25357fbc 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -104,10 +104,13 @@ set(BOOST_URL_TESTS_FILES ) set(SUITE_FILES ../../extra/test_main.cpp ../../extra/test_suite.hpp) +set(EXAMPLE_FILES ../../example/router/impl/matches.cpp ../../example/router/detail/impl/router.cpp) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${BOOST_URL_TESTS_FILES}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../extra PREFIX "_extra" FILES ${SUITE_FILES}) -add_executable(boost_url_tests ${BOOST_URL_TESTS_FILES} ${SUITE_FILES}) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../example/router PREFIX "_router" FILES ${EXAMPLE_FILES}) + +add_executable(boost_url_tests ${BOOST_URL_TESTS_FILES} ${SUITE_FILES} ${EXAMPLE_FILES}) target_include_directories(boost_url_tests PRIVATE . ../../extra) target_include_directories(boost_url_tests PRIVATE ../../example/router) # The include dependencies are found in the CMakeLists.txt @@ -121,11 +124,15 @@ target_link_libraries(boost_url_tests PRIVATE add_test(NAME boost_url_tests COMMAND boost_url_tests) add_dependencies(boost_url_all_tests boost_url_tests) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(boost_url_tests PUBLIC -Wno-error=unused-but-set-variable) + target_compile_options( + boost_url_tests + PUBLIC + -Wno-unused-but-set-variable + -Wno-unused-function) if (TARGET boost_filesystem AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") get_target_property(FS_IS_IMPORTED boost_filesystem IMPORTED) if (FS_IS_IMPORTED) - target_compile_options(boost_filesystem PUBLIC -Wno-error=restrict) + target_compile_options(boost_filesystem PUBLIC -Wno-restrict) endif() endif() endif() \ No newline at end of file diff --git a/test/unit/Jamfile b/test/unit/Jamfile index aab2dd31..38ea7d62 100644 --- a/test/unit/Jamfile +++ b/test/unit/Jamfile @@ -100,7 +100,6 @@ local SOURCES = rfc/unreserved_chars.cpp rfc/uri_rule.cpp rfc/uri_reference_rule.cpp - example/router/router.cpp compat/ada.cpp ; for local f in $(SOURCES) @@ -109,3 +108,4 @@ for local f in $(SOURCES) } run doc_grammar.cpp /boost/url//boost_url : : : off ; run doc_3_urls.cpp /boost/url//boost_url : : : off ; +run example/router/router.cpp ../../example/router/impl/matches.cpp ../../example/router/detail/impl/router.cpp /boost/url//boost_url : : : off ; diff --git a/test/unit/example/router/router.cpp b/test/unit/example/router/router.cpp index bbc6b7ac..837c8318 100644 --- a/test/unit/example/router/router.cpp +++ b/test/unit/example/router/router.cpp @@ -13,7 +13,6 @@ #endif #include "router.hpp" -#include "src.hpp" #include "test_suite.hpp"