Explorar el Código

cxxopts: Fix compilation with gcc15 (#7085)

Jérôme Leclercq hace 4 meses
padre
commit
282c98a718

+ 12 - 0
packages/c/cxxopts/patches/missing-gcc15-header.patch

@@ -0,0 +1,12 @@
+diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp
+index 991ba3fc..a2e71faf 100644
+--- a/include/cxxopts.hpp
++++ b/include/cxxopts.hpp
+@@ -27,6 +27,7 @@ THE SOFTWARE.
+ #ifndef CXXOPTS_HPP_INCLUDED
+ #define CXXOPTS_HPP_INCLUDED
+ 
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <exception>

+ 6 - 3
packages/c/cxxopts/xmake.lua

@@ -1,18 +1,20 @@
 package("cxxopts")
-
     set_kind("library", {headeronly = true})
     set_homepage("https://github.com/jarro2783/cxxopts")
     set_description("Lightweight C++ command line option parser")
     set_license("MIT")
 
-    add_urls("https://github.com/jarro2783/cxxopts.git")
-    add_urls("https://github.com/jarro2783/cxxopts/archive/$(version).tar.gz")
+    add_urls("https://github.com/jarro2783/cxxopts/archive/$(version).tar.gz",
+             "https://github.com/jarro2783/cxxopts.git")
+
     add_versions("v3.2.1", "841f49f2e045b9c6365997c2a8fbf76e6f215042dda4511a5bb04bc5ebc7f88a")
     add_versions("v3.2.0", "9f43fa972532e5df6c5fd5ad0f5bac606cdec541ccaf1732463d8070bbb7f03b")
     add_versions("v3.1.1", "523175f792eb0ff04f9e653c90746c12655f10cb70f1d5e6d6d9491420298a08")
     add_versions("v3.0.0", "36f41fa2a46b3c1466613b63f3fa73dc24d912bc90d667147f1e43215a8c6d00")
     add_versions("v2.2.0", "447dbfc2361fce9742c5d1c9cfb25731c977b405f9085a738fbd608626da8a4d")
 
+    add_patches("v3.2.1", path.join(os.scriptdir(), "patches", "missing-gcc15-header.patch"), "db4bb2b9e267a8223fb133d09aceba2f08d0bc18aee9b99d2506673ce328d108")
+
     if is_plat("mingw") and is_subhost("msys") then
         add_extsources("pacman::cxxopts")
     elseif is_plat("linux") then
@@ -22,6 +24,7 @@ package("cxxopts")
     end
 
     add_deps("cmake")
+
     on_install(function (package)
         local configs = {"-DCXXOPTS_BUILD_EXAMPLES=OFF", "-DCXXOPTS_BUILD_TESTS=OFF"}
         import("package.tools.cmake").install(package, configs)