]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Improve build of bundled cxxurl third party dependency
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 24 Mar 2024 10:00:10 +0000 (11:00 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 27 Apr 2024 08:14:29 +0000 (10:14 +0200)
13 files changed:
.clang-format
LICENSE.adoc
src/ccache/CMakeLists.txt
src/ccache/storage/Storage.cpp
src/ccache/storage/remote/FileStorage.hpp
src/ccache/storage/remote/HttpStorage.cpp
src/ccache/storage/remote/HttpStorage.hpp
src/ccache/storage/remote/RedisStorage.hpp
src/ccache/storage/remote/RemoteStorage.hpp
src/third_party/CMakeLists.txt
src/third_party/cxxurl/CMakeLists.txt [new file with mode: 0644]
src/third_party/cxxurl/cxxurl/url.cpp [moved from src/third_party/url.cpp with 100% similarity]
src/third_party/cxxurl/cxxurl/url.hpp [moved from src/third_party/url.hpp with 100% similarity]

index 3910db4d905489ca0c67d5be7c789db14b22f9ba..d41fa25d81eaac7e8e49afd016d114ac0ea0303d 100644 (file)
@@ -31,7 +31,7 @@ IncludeCategories:
   - Regex: '^<ccache/'
     Priority: 2
   # Dependency headers:
-  - Regex: '^<(doctest/.*|fmt/.*|hiredis/.*|httplib\.h|nonstd/.*|tl/expected\.hpp|zstd\.h)>$'
+  - Regex: '^<(cxxurl/url\.hpp|doctest/.*|fmt/.*|hiredis/.*|httplib\.h|nonstd/.*|tl/expected\.hpp|zstd\.h)>$'
     Priority: 3
   # System headers:
   - Regex: '\.h.*>$'
index c8e824a2d2a0e1c7804ce018e6e76907e9d3ec3c..901bd7e7d63d5c43afb29a9f47405a89686ca68c 100644 (file)
@@ -418,6 +418,36 @@ SOFTWARE.
 ----
 
 
+=== src/third_party/cxxurl/cxxurl/url.*
+
+CxxUrl - A simple C++ URL class. Copied from CxxUrl v0.3 downloaded from
+<https://github.com/chmike/CxxUrl>. 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
-<https://github.com/chmike/CxxUrl>. 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
index 5952e8801f3bfd8aa1754c32b9f089119c606395..8169c98e20839b077a569696b5137d84bb2656dc 100644 (file)
@@ -45,6 +45,7 @@ find_package(Threads REQUIRED)
 target_link_libraries(
   ccache_framework
   PUBLIC
+    dep_cxxurl
     dep_fmt
     dep_nonstdspan
     dep_tlexpected
index 7155f705a0b74e6b5d41382ebcb4ca5814342ac2..1149940c9620c4ac692e52f64143bda8b29b94c5 100644 (file)
@@ -39,7 +39,7 @@
 #include <ccache/util/logging.hpp>
 #include <ccache/util/string.hpp>
 
-#include <url.hpp>
+#include <cxxurl/url.hpp>
 
 #include <cmath>
 #include <memory>
index 4fb61b1aa0880cdc6e3686b298d549eb8c18079a..a5d067f21732d4bd5440205912e5b64f9803f182 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <ccache/storage/remote/RemoteStorage.hpp>
 
-#include <url.hpp>
+#include <cxxurl/url.hpp>
 
 #include <memory>
 #include <vector>
index a74da0ea15214273fbda701047aef78a90d3b23b..37221dec9c4f2727d9996bd7b47d6b9b7d4a56d5 100644 (file)
 #include <ccache/util/string.hpp>
 #include <ccache/util/types.hpp>
 
+#include <cxxurl/url.hpp>
 #include <httplib.h>
 
-#include <url.hpp>
-
 #include <string_view>
 
 namespace storage::remote {
index fd3f4cfe1e43ab19a15f6bcc55a4faf38ad115e5..f7213b09d9164a41d46e151ff8591ba0abd76e0e 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <ccache/storage/remote/RemoteStorage.hpp>
 
-#include <url.hpp>
+#include <cxxurl/url.hpp>
 
 #include <memory>
 #include <vector>
index be4ac2794e6e816f4b0435cceca0e1a9a8a3874b..9c16bcfd26606a6216e3f55f4cfbf2c2acb98e8c 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <ccache/storage/remote/RemoteStorage.hpp>
 
-#include <url.hpp>
+#include <cxxurl/url.hpp>
 
 #include <memory>
 #include <vector>
index 341b47bdc1fdf428340d28fee405d978afb1dd90..afa8f96b46d59c29e7f78f3dbc0d0e651720b066 100644 (file)
 #include <ccache/Hash.hpp>
 #include <ccache/util/Bytes.hpp>
 
+#include <cxxurl/url.hpp>
 #include <nonstd/span.hpp>
 #include <tl/expected.hpp>
 
-#include <url.hpp>
-
 #include <chrono>
 #include <memory>
 #include <optional>
index 2f28156b4403a808f31551dbdc0be13914470dc0..de420646e781f775e8c94fb8cebfe2519ff8b4e2 100644 (file)
@@ -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 (file)
index 0000000..b67dc4a
--- /dev/null
@@ -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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
+)