Skip to content

Commit b095c0b

Browse files
star-hengxingstd-microblock
authored andcommitted
build: sync upstream zasm package
1 parent 8004858 commit b095c0b

File tree

1 file changed

+0
-71
lines changed

1 file changed

+0
-71
lines changed

xmake.lua

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -42,74 +42,3 @@ target("blook-test")
4242
add_deps("blook")
4343

4444
add_tests("default")
45-
46-
package("zasm")
47-
set_homepage("https://github.com/zyantific/zasm")
48-
set_description("x86-64 Assembler based on Zydis")
49-
50-
set_urls("https://github.com/zyantific/zasm.git")
51-
52-
add_versions("2025.03.02", "c239a78b51c1b0060296193174d78b802f02a618")
53-
add_versions("2024.05.14", "bea8af2c68f0cbe8a02e93ab79a8b5c596d2b232")
54-
add_versions("2023.06.21", "19a642518eccbb1740865642eaf3ce79d5d5b884")
55-
56-
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
57-
58-
on_load(function (package)
59-
local map = {
60-
["2025.03.02"] = "4.1.0",
61-
["2024.05.14"] = "4.1.0",
62-
["2023.06.21"] = "4.0.0",
63-
}
64-
local zydis_version = map[package:version()]
65-
if zydis_version then
66-
package:add("deps", "zydis " .. zydis_version)
67-
else
68-
package:add("deps", "zydis")
69-
end
70-
end)
71-
72-
on_install("!wasm and !iphoneos", function (package)
73-
local src_include
74-
if package:version() and package:version():lt("2024.05.14") then
75-
src_include = [[
76-
add_files("src/zasm/**.cpp")
77-
add_includedirs("include", "src/zasm/src")
78-
add_headerfiles("include/(**.hpp)")
79-
]]
80-
else
81-
src_include = [[
82-
add_files("zasm/**.cpp")
83-
add_includedirs("zasm/include")
84-
add_headerfiles("zasm/include/(**.hpp)")
85-
]]
86-
end
87-
88-
io.writefile("xmake.lua", format([[
89-
add_rules("mode.debug", "mode.release")
90-
add_requires("zydis v4.0.0")
91-
target("zasm")
92-
set_kind("$(kind)")
93-
set_languages("c++17")
94-
%s
95-
if is_plat("windows") then
96-
add_cxxflags("/bigobj", "/MP", "/W3", "/permissive-")
97-
if is_kind("shared") then
98-
add_rules("utils.symbols.export_all", {export_classes = true})
99-
end
100-
end
101-
add_packages("zydis")
102-
]], src_include))
103-
import("package.tools.xmake").install(package)
104-
end)
105-
106-
on_test(function (package)
107-
assert(package:check_cxxsnippets({test = [[
108-
#include <zasm/serialization/serializer.hpp>
109-
#include <zasm/zasm.hpp>
110-
using namespace zasm;
111-
void test() {
112-
Program program(MachineMode::AMD64);
113-
}
114-
]]}, {configs = {languages = "c++17"}}))
115-
end)

0 commit comments

Comments
 (0)