|
@@ -4,31 +4,35 @@ package("capstone")
|
|
|
set_license("BSD-3-Clause")
|
|
|
|
|
|
add_urls("https://github.com/capstone-engine/capstone/archive/refs/tags/$(version).tar.gz",
|
|
|
- "https://github.com/capstone-engine/capstone.git")
|
|
|
+ "https://github.com/capstone-engine/capstone.git", {submodules = false})
|
|
|
|
|
|
+ add_versions("5.0.5", "3bfd3e7085fbf0fab75fb1454067bf734bb0bebe9b670af7ce775192209348e9")
|
|
|
add_versions("5.0.3", "3970c63ca1f8755f2c8e69b41432b710ff634f1b45ee4e5351defec4ec8e1753")
|
|
|
|
|
|
add_deps("cmake")
|
|
|
|
|
|
on_install("!iphoneos", function (package)
|
|
|
- package:addenv("PATH", "bin")
|
|
|
+ if not package:is_cross() then
|
|
|
+ package:addenv("PATH", "bin")
|
|
|
+ end
|
|
|
+
|
|
|
+ io.replace("CMakeLists.txt", "include(CPackConfig.txt)", "", {plain = true})
|
|
|
|
|
|
local configs = {
|
|
|
"-DCAPSTONE_BUILD_CSTOOL=ON",
|
|
|
- "-DCAPSTONE_BUILD_STATIC_RUNTIME=OFF", -- Use our pass CMAKE_MSVC_RUNTIME_LIBRARY
|
|
|
"-DCAPSTONE_BUILD_LEGACY_TESTS=OFF",
|
|
|
"-DCAPSTONE_BUILD_TESTS=OFF",
|
|
|
+ -- xmake will pass CMAKE_MSVC_RUNTIME_LIBRARY
|
|
|
+ "-DCAPSTONE_BUILD_STATIC_RUNTIME=OFF",
|
|
|
+ "-DCAPSTONE_BUILD_STATIC_MSVC_RUNTIME=OFF",
|
|
|
}
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
+ table.insert(configs, "-DCAPSTONE_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
+ table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
|
|
|
+ table.insert(configs, "-DCAPSTONE_BUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
|
|
|
table.insert(configs, "-DENABLE_ASAN=" .. (package:config("asan") and "ON" or "OFF"))
|
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
-
|
|
|
- if package:is_plat("windows") and package:is_debug() then
|
|
|
- local dir = package:installdir(package:config("shared") and "bin" or "lib")
|
|
|
- os.trycp(path.join(package:buildir(), "capstone.pdb"), dir)
|
|
|
- os.trycp(path.join(package:buildir(), "cstool.pdb"), package:installdir("bin"))
|
|
|
- end
|
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|