add event trace config for mimalloc (#4464)

* add event trace config for mimalloc

* Update xmake.lua
pull/4481/head
xpxz 7 months ago committed by GitHub
parent 00fc015b48
commit 8e2999c6ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      packages/m/mimalloc/xmake.lua

@ -23,7 +23,10 @@ package("mimalloc")
add_configs("secure", {description = "Use a secured version of mimalloc", default = false, type = "boolean"})
add_configs("rltgenrandom", {description = "Use a RtlGenRandom instead of BCrypt", default = false, type = "boolean"})
if is_plat("windows") then
add_configs("etw", {description = "Enable Event tracing for Windows", default = false, type = "boolean"})
end
add_deps("cmake")
if is_plat("windows") then
@ -45,6 +48,8 @@ package("mimalloc")
table.insert(configs, "-DMI_BUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
table.insert(configs, "-DMI_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DMI_SECURE=" .. (package:config("secure") and "ON" or "OFF"))
table.insert(configs, "-DMI_TRACK_ETW=" .. (package:config("etw") and "ON" or "OFF"))
--x64:mimalloc-redirect.lib/dll x86:mimalloc-redirect32.lib/dll
if package:version():le("2.0.1") and package:config("shared") and package:is_plat("windows") and package:is_arch("x86") then
io.replace("CMakeLists.txt", "-redirect.", "-redirect32.", {plain = true})

Loading…
Cancel
Save