Skip to content

Commit

Permalink
glaze: add v3.6.2 version (#5440)
Browse files Browse the repository at this point in the history
* glaze: add v3.6.2 version

* improve check

* add check for android

* add check for low version gcc
  • Loading branch information
star-hengxing authored Oct 8, 2024
1 parent 6001739 commit ac8c8da
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions packages/g/glaze/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package("glaze")
add_urls("https://github.com/stephenberry/glaze/archive/refs/tags/$(version).tar.gz",
"https://github.com/stephenberry/glaze.git")

add_versions("v3.6.2", "74b14656b7a47c0a03d0a857adf5059e8c2351a7a84623593be0dd16b293216c")
add_versions("v3.6.0", "d394fed35440bd1cb1a2aec059b967acc43fc04764ecb0915ba24b9f5a9ca0a3")
add_versions("v3.3.2", "e492d3f662c3c096ce7abac86780af6c84f74c4f19b29223ad92fccc054aafad")
add_versions("v3.1.7", "388483bb3dfa1fe25c1dfec24f0afd1651e0303833cfa1b7f51020a2569e992a")
Expand All @@ -24,18 +25,41 @@ package("glaze")

if on_check then
on_check(function (package)
if package:is_plat("windows") then
local vs_toolset = package:toolchain("msvc"):config("vs_toolset")
if vs_toolset then
local vs_toolset_ver = import("core.base.semver").new(vs_toolset)
local minor = vs_toolset_ver:minor()
assert(minor and minor >= 30, "package(glaze) require vs_toolset >= 14.3")
end
elseif package:is_plat("android") then
local ndk = package:toolchain("ndk"):config("ndkver")
assert(ndk and tonumber(ndk) >= 27, "package(glaze) require ndk version >= 27")
end

if package:has_tool("cxx", "gcc") then
assert(package:check_cxxsnippets({test = [[
constexpr void f() {
static constexpr int g = 1;
}
]]}, {configs = {languages = "c++2b"}}), "package(glaze) require >= c++23")
end

assert(package:check_cxxsnippets({test = [[
constexpr void f() {
static constexpr int g = 1;
#include <bit>
#include <cstdint>
void test() {
constexpr double f64v = 19880124.0;
constexpr auto u64v = std::bit_cast<std::uint64_t>(f64v);
}
]]}, {configs = {languages = "c++2b"}}), "package(glaze) Require at least C++23.")
]]}, {configs = {languages = "c++20"}}), "package(glaze) require >= c++20")
end)
end

on_install("windows", "linux", "macosx", "bsd", "mingw", "wasm", function (package)
on_install(function (package)
local version = package:version()
if version and version:ge("2.9.5") then
if package:has_tool("cxx", "cl", "clang_cl") then
if package:has_tool("cxx", "cl") then
package:add("cxxflags", "/Zc:preprocessor", "/permissive-", "/Zc:lambda")
end

Expand Down

0 comments on commit ac8c8da

Please sign in to comment.