xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("microsoft-detours")
  2. set_homepage("https://github.com/microsoft/Detours")
  3. set_description("Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.")
  4. set_license("MIT")
  5. set_urls("https://github.com/microsoft/Detours.git")
  6. add_versions("2023.6.8", "734ac64899c44933151c1335f6ef54a590219221")
  7. on_install("windows", "mingw", function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.debug", "mode.release")
  10. target("microsoft-detours")
  11. set_kind("$(kind)")
  12. add_files("src/*.cpp|uimports.cpp")
  13. add_headerfiles("src/*.h")
  14. add_defines("WIN32_LEAN_AND_MEAN")
  15. if is_mode("debug") then
  16. add_defines("DETOUR_DEBUG=1")
  17. end
  18. ]])
  19. if package:is_debug() then
  20. package:add("defines", "DETOUR_DEBUG=1")
  21. end
  22. import("package.tools.xmake").install(package)
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include <windows.h>
  27. #include <detours.h>
  28. void test() {
  29. DetourIsHelperProcess();
  30. }
  31. ]]}))
  32. end)