From: Joel Rosdahl Date: Sun, 24 Mar 2024 10:00:10 +0000 (+0100) Subject: build: Improve build of bundled cxxurl third party dependency X-Git-Tag: v4.10~42^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f628b169c216145400d839de1e31e1e6abde7d67;p=thirdparty%2Fccache.git build: Improve build of bundled cxxurl third party dependency --- diff --git a/.clang-format b/.clang-format index 3910db4d..d41fa25d 100644 --- a/.clang-format +++ b/.clang-format @@ -31,7 +31,7 @@ IncludeCategories: - Regex: '^$' + - Regex: '^<(cxxurl/url\.hpp|doctest/.*|fmt/.*|hiredis/.*|httplib\.h|nonstd/.*|tl/expected\.hpp|zstd\.h)>$' Priority: 3 # System headers: - Regex: '\.h.*>$' diff --git a/LICENSE.adoc b/LICENSE.adoc index c8e824a2..901bd7e7 100644 --- a/LICENSE.adoc +++ b/LICENSE.adoc @@ -418,6 +418,36 @@ SOFTWARE. ---- +=== src/third_party/cxxurl/cxxurl/url.* + +CxxUrl - A simple C++ URL class. Copied from CxxUrl v0.3 downloaded from +. It has the following license text: + +---- +The MIT License (MIT) + +Copyright (c) 2015 Christophe Meessen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +---- + + === src/third_party/nonstd-span/nonstd/span.hpp This is the single header version of @@ -583,36 +613,6 @@ express Statement of Purpose. ---- -=== src/third_party/url.* - -CxxUrl - A simple C++ URL class. Copied from CxxUrl v0.3 downloaded from -. It has the following license text: - ----- -The MIT License (MIT) - -Copyright (c) 2015 Christophe Meessen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ----- - - === src/third_party/win32/getopt.* This implementation of `getopt_long()` for Win32 was taken from diff --git a/src/ccache/CMakeLists.txt b/src/ccache/CMakeLists.txt index 5952e880..8169c98e 100644 --- a/src/ccache/CMakeLists.txt +++ b/src/ccache/CMakeLists.txt @@ -45,6 +45,7 @@ find_package(Threads REQUIRED) target_link_libraries( ccache_framework PUBLIC + dep_cxxurl dep_fmt dep_nonstdspan dep_tlexpected diff --git a/src/ccache/storage/Storage.cpp b/src/ccache/storage/Storage.cpp index 7155f705..1149940c 100644 --- a/src/ccache/storage/Storage.cpp +++ b/src/ccache/storage/Storage.cpp @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include diff --git a/src/ccache/storage/remote/FileStorage.hpp b/src/ccache/storage/remote/FileStorage.hpp index 4fb61b1a..a5d067f2 100644 --- a/src/ccache/storage/remote/FileStorage.hpp +++ b/src/ccache/storage/remote/FileStorage.hpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include diff --git a/src/ccache/storage/remote/HttpStorage.cpp b/src/ccache/storage/remote/HttpStorage.cpp index a74da0ea..37221dec 100644 --- a/src/ccache/storage/remote/HttpStorage.cpp +++ b/src/ccache/storage/remote/HttpStorage.cpp @@ -29,10 +29,9 @@ #include #include +#include #include -#include - #include namespace storage::remote { diff --git a/src/ccache/storage/remote/HttpStorage.hpp b/src/ccache/storage/remote/HttpStorage.hpp index fd3f4cfe..f7213b09 100644 --- a/src/ccache/storage/remote/HttpStorage.hpp +++ b/src/ccache/storage/remote/HttpStorage.hpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include diff --git a/src/ccache/storage/remote/RedisStorage.hpp b/src/ccache/storage/remote/RedisStorage.hpp index be4ac279..9c16bcfd 100644 --- a/src/ccache/storage/remote/RedisStorage.hpp +++ b/src/ccache/storage/remote/RedisStorage.hpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include diff --git a/src/ccache/storage/remote/RemoteStorage.hpp b/src/ccache/storage/remote/RemoteStorage.hpp index 341b47bd..afa8f96b 100644 --- a/src/ccache/storage/remote/RemoteStorage.hpp +++ b/src/ccache/storage/remote/RemoteStorage.hpp @@ -21,11 +21,10 @@ #include #include +#include #include #include -#include - #include #include #include diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt index 2f28156b..de420646 100644 --- a/src/third_party/CMakeLists.txt +++ b/src/third_party/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(third_party STATIC url.cpp xxhash.c) +add_library(third_party STATIC xxhash.c) target_include_directories(third_party INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if(MSVC) @@ -55,6 +55,7 @@ if(MSVC) endif() add_subdirectory(blake3) +add_subdirectory(cxxurl) if(NOT TARGET dep_cpphttplib) add_subdirectory(cpp-httplib) diff --git a/src/third_party/cxxurl/CMakeLists.txt b/src/third_party/cxxurl/CMakeLists.txt new file mode 100644 index 00000000..b67dc4a7 --- /dev/null +++ b/src/third_party/cxxurl/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library( + dep_cxxurl + STATIC EXCLUDE_FROM_ALL + "${CMAKE_CURRENT_SOURCE_DIR}/cxxurl/url.cpp" +) +target_include_directories( + dep_cxxurl + SYSTEM INTERFACE "$" +) diff --git a/src/third_party/url.cpp b/src/third_party/cxxurl/cxxurl/url.cpp similarity index 100% rename from src/third_party/url.cpp rename to src/third_party/cxxurl/cxxurl/url.cpp diff --git a/src/third_party/url.hpp b/src/third_party/cxxurl/cxxurl/url.hpp similarity index 100% rename from src/third_party/url.hpp rename to src/third_party/cxxurl/cxxurl/url.hpp