xmake.lua 995 B

12345678910111213141516171819202122232425
  1. package("dlfcn-win32")
  2. set_homepage("https://github.com/dlfcn-win32/dlfcn-win32")
  3. set_description("Official dlfcn-win32 repo")
  4. set_license("MIT")
  5. add_urls("https://github.com/dlfcn-win32/dlfcn-win32/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/dlfcn-win32/dlfcn-win32.git")
  7. add_versions("v1.4.1", "30a9f72bdf674857899eb7e553df1f0d362c5da2a576ae51f886e1171fbdb399")
  8. add_deps("cmake")
  9. on_install(function (package)
  10. local configs = {}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  12. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  13. import("package.tools.cmake").install(package, configs)
  14. if package:config("shared") then
  15. package:add("defines", "DLFCN_WIN32_SHARED")
  16. end
  17. end)
  18. on_test(function (package)
  19. assert(package:has_cfuncs("dlopen", {includes = "dlfcn.h"}))
  20. end)