abseil: remove limits (#4935)

* abseil: remove limits

* abseil: fix indentation of test
pull/4936/head
Chi Huu Huynh 3 months ago committed by GitHub
parent 5968ee1f78
commit 3351bd1150
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      packages/a/abseil/xmake.lua

@ -1,11 +1,11 @@
package("abseil") package("abseil")
set_homepage("https://abseil.io") set_homepage("https://abseil.io")
set_description("C++ Common Libraries") set_description("C++ Common Libraries")
set_license("Apache-2.0") set_license("Apache-2.0")
add_urls("https://github.com/abseil/abseil-cpp/archive/$(version).tar.gz", add_urls("https://github.com/abseil/abseil-cpp/archive/$(version).tar.gz",
"https://github.com/abseil/abseil-cpp.git") "https://github.com/abseil/abseil-cpp.git")
add_versions("20200225.1", "0db0d26f43ba6806a8a3338da3e646bb581f0ca5359b3a201d8fb8e4752fd5f8") add_versions("20200225.1", "0db0d26f43ba6806a8a3338da3e646bb581f0ca5359b3a201d8fb8e4752fd5f8")
add_versions("20210324.1", "441db7c09a0565376ecacf0085b2d4c2bbedde6115d7773551bc116212c2a8d6") add_versions("20210324.1", "441db7c09a0565376ecacf0085b2d4c2bbedde6115d7773551bc116212c2a8d6")
add_versions("20210324.2", "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f") add_versions("20210324.2", "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f")
@ -24,7 +24,9 @@ package("abseil")
add_configs("cxx_standard", {description = "Select c++ standard to build.", default = "17", type = "string", values = {"14", "17", "20"}}) add_configs("cxx_standard", {description = "Select c++ standard to build.", default = "17", type = "string", values = {"14", "17", "20"}})
if is_plat("macosx") then if is_plat("linux") then
add_syslinks("pthread")
elseif is_plat("macosx") then
add_frameworks("CoreFoundation") add_frameworks("CoreFoundation")
end end
@ -34,7 +36,7 @@ package("abseil")
end end
end) end)
on_install("macosx", "linux", "windows", "mingw", "cross", function (package) on_install(function (package)
if package:version() and package:version():eq("20230802.1") and package:is_plat("mingw") then if package:version() and package:version():eq("20230802.1") and package:is_plat("mingw") then
io.replace(path.join("absl", "synchronization", "internal", "pthread_waiter.h"), "#ifndef _WIN32", "#if !defined(_WIN32) && !defined(__MINGW32__)", {plain = true}) io.replace(path.join("absl", "synchronization", "internal", "pthread_waiter.h"), "#ifndef _WIN32", "#if !defined(_WIN32) && !defined(__MINGW32__)", {plain = true})
io.replace(path.join("absl", "synchronization", "internal", "win32_waiter.h"), "#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", "#if defined(_WIN32) && !defined(__MINGW32__) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", {plain = true}) io.replace(path.join("absl", "synchronization", "internal", "win32_waiter.h"), "#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", "#if defined(_WIN32) && !defined(__MINGW32__) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", {plain = true})
@ -80,11 +82,11 @@ package("abseil")
#include <string> #include <string>
#include <vector> #include <vector>
void test() { void test() {
std::vector<std::string> v = {"foo", "bar", "baz"}; std::vector<std::string> v = {"foo", "bar", "baz"};
std::string s = absl::StrJoin(v, "-"); std::string s = absl::StrJoin(v, "-");
int result = 0; int result = 0;
auto a = absl::SimpleAtoi("123", &result); auto a = absl::SimpleAtoi("123", &result);
std::cout << "Joined string: " << s << "\\n"; std::cout << "Joined string: " << s << "\\n";
} }
]]}, {configs = {languages = "cxx17"}})) ]]}, {configs = {languages = "cxx17"}}))
end) end)

Loading…
Cancel
Save