|
|
|
@ -1,5 +1,4 @@ |
|
|
|
|
package("asmtk") |
|
|
|
|
|
|
|
|
|
set_homepage("https://github.com/asmjit/asmtk") |
|
|
|
|
set_description("Assembler toolkit based on AsmJit") |
|
|
|
|
set_license("zlib") |
|
|
|
@ -10,6 +9,9 @@ package("asmtk") |
|
|
|
|
add_deps("asmjit") |
|
|
|
|
|
|
|
|
|
on_install("windows", "linux", "macosx", function (package) |
|
|
|
|
if not package:config("shared") then |
|
|
|
|
package:add("defines", "ASMTK_STATIC") |
|
|
|
|
end |
|
|
|
|
io.writefile("xmake.lua", [[ |
|
|
|
|
add_rules("mode.debug", "mode.release") |
|
|
|
|
add_requires("asmjit") |
|
|
|
@ -18,6 +20,11 @@ package("asmtk") |
|
|
|
|
add_files("src/**.cpp") |
|
|
|
|
add_headerfiles("src/(**.h)") |
|
|
|
|
set_languages("c++11") |
|
|
|
|
if is_kind("static") then |
|
|
|
|
add_defines("ASMTK_STATIC") |
|
|
|
|
elseif is_kind("shared") then |
|
|
|
|
add_defines("ASMTK_EXPORTS") |
|
|
|
|
end |
|
|
|
|
if is_plat("windows") then |
|
|
|
|
add_cxxflags("/GR-", "/GF", "/Zc:inline", "/Zc:strictStrings", "/Zc:threadSafeInit-") |
|
|
|
|
if is_mode("debug") then |
|
|
|
@ -25,30 +32,26 @@ package("asmtk") |
|
|
|
|
else |
|
|
|
|
add_cxxflags("/GS-", "/Oi") |
|
|
|
|
end |
|
|
|
|
if is_kind("shared") then |
|
|
|
|
add_rules("utils.symbols.export_all", {export_classes = true}) |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
add_cxxflags("-fno-math-errno", "-fno-threadsafe-statics") |
|
|
|
|
end |
|
|
|
|
add_packages("asmjit") |
|
|
|
|
]]) |
|
|
|
|
local configs = {} |
|
|
|
|
if package:config("shared") then |
|
|
|
|
configs.kind = "shared" |
|
|
|
|
end |
|
|
|
|
import("package.tools.xmake").install(package, configs) |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
|
assert(package:check_cxxsnippets({test = [[ |
|
|
|
|
#include <asmtk/asmtk.h> |
|
|
|
|
#include <asmjit/asmjit.h> |
|
|
|
|
using namespace asmjit; |
|
|
|
|
using namespace asmtk; |
|
|
|
|
void test() { |
|
|
|
|
Environment env(Arch::kX64); |
|
|
|
|
CodeHolder code; |
|
|
|
|
code.init(env); |
|
|
|
|
x86::Assembler a(&code); |
|
|
|
|
AsmParser p(&a); |
|
|
|
|
} |
|
|
|
|
]]}, {configs = {languages = "c++11"}})) |
|
|
|
|
end) |
|
|
|
|