xmake.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package("microprofile")
  2. set_homepage("https://github.com/jonasmr/microprofile")
  3. set_description("microprofile is an embeddable profiler")
  4. set_license("Unlicense")
  5. add_urls("https://github.com/jonasmr/microprofile/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/jonasmr/microprofile.git")
  7. add_versions("v4.0", "59cd3ee7afd3ce5cfeb7599db62ccc0611818985a8e649353bec157122902a5c")
  8. if is_plat("windows") then
  9. add_syslinks("ws2_32", "advapi32", "shell32")
  10. add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true})
  11. elseif is_plat("linux", "bsd") then
  12. add_syslinks("pthread")
  13. end
  14. add_deps("stb")
  15. on_install("windows", "linux", "macosx", "bsd", "android", "iphoneos", function (package)
  16. io.writefile("xmake.lua", [[
  17. add_rules("mode.debug", "mode.release")
  18. set_languages("c++11")
  19. add_requires("stb")
  20. target("microprofile")
  21. set_kind("$(kind)")
  22. add_files("microprofile.cpp")
  23. add_headerfiles("microprofile.h", "microprofile_html.h")
  24. if is_plat("windows") then
  25. add_syslinks("ws2_32", "advapi32", "shell32")
  26. if is_plat("windows") and is_kind("shared") then
  27. add_rules("utils.symbols.export_all", {export_classes = true})
  28. end
  29. elseif is_plat("linux", "bsd") then
  30. add_syslinks("pthread")
  31. end
  32. add_packages("stb")
  33. ]])
  34. import("package.tools.xmake").install(package)
  35. end)
  36. on_test(function (package)
  37. assert(package:has_cfuncs("MicroProfileFlip", {includes = "microprofile.h"}))
  38. end)