Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make glaze multiplatform #4637

Merged
merged 3 commits into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions packages/g/glaze/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package("glaze")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/stephenberry/glaze")
set_description("Extremely fast, in memory, JSON and interface library for modern C++")
set_license("MIT")

add_urls("https://github.com/stephenberry/glaze/archive/refs/tags/$(version).tar.gz",
"https://github.com/stephenberry/glaze.git")
Expand All @@ -16,8 +17,31 @@ package("glaze")
add_versions("v2.2.0", "1d6e36029a58bf8c4bdd035819e1ab02b87d8454dd80fa2f5d46c96a1e6d600c")
add_versions("v1.3.5", "de5d59cb7f31193d45f67f25d8ced1499df50c0d926a1461432b87f2b2368817")

on_install("linux", function (package)
os.cp("include", package:installdir())
add_deps("cmake")

if on_check then
on_check("windows", function (package)
if package:is_plat("windows") then
local vs = package:toolchain("msvc"):config("vs")
assert(vs and tonumber(vs) >= 2022, "package(glaze): need vs >= 2022")
end
end)
end

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

import("package.tools.cmake").install(package, {
"-Dglaze_DEVELOPER_MODE=OFF",
"-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")
})
else
os.cp("include", package:installdir())
end
end)

on_test(function (package)
Expand Down
Loading