microsoft-detours: support mingw (#3014)

pull/3016/head
star9029 11 months ago committed by GitHub
parent d49fecf437
commit c292580ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      packages/m/microsoft-detours/xmake.lua

@ -1,5 +1,4 @@
package("microsoft-detours") package("microsoft-detours")
set_homepage("https://github.com/microsoft/Detours") set_homepage("https://github.com/microsoft/Detours")
set_description("Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.") set_description("Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.")
set_license("MIT") set_license("MIT")
@ -7,8 +6,7 @@ package("microsoft-detours")
set_urls("https://github.com/microsoft/Detours.git") set_urls("https://github.com/microsoft/Detours.git")
add_versions("2023.6.8", "734ac64899c44933151c1335f6ef54a590219221") add_versions("2023.6.8", "734ac64899c44933151c1335f6ef54a590219221")
on_install("windows", function (package) on_install("windows", "mingw", function (package)
local configs = {}
io.writefile("xmake.lua", [[ io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release") add_rules("mode.debug", "mode.release")
target("microsoft-detours") target("microsoft-detours")
@ -20,13 +18,10 @@ package("microsoft-detours")
add_defines("DETOUR_DEBUG=1") add_defines("DETOUR_DEBUG=1")
end end
]]) ]])
if package:config("shared") then
configs.kind = "shared"
end
if package:is_debug() then if package:is_debug() then
package:add("defines", "DETOUR_DEBUG=1") package:add("defines", "DETOUR_DEBUG=1")
end end
import("package.tools.xmake").install(package, configs) import("package.tools.xmake").install(package)
end) end)
on_test(function (package) on_test(function (package)

Loading…
Cancel
Save