2
0

xmake.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("platformfolders")
  2. set_homepage("https://github.com/sago007/PlatformFolders")
  3. set_description([[A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows or Mac OS X specific code]])
  4. set_license("MIT")
  5. add_urls("https://github.com/sago007/PlatformFolders/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/sago007/PlatformFolders.git")
  7. add_versions("4.2.0", "31bb0f64a27315aec8994f226332aaafe9888d00bb69a2ff2dff9912e2f4ccf4")
  8. add_patches("4.2.0", "patches/4.2.0/cmake-install.patch", "a38850ff7e9b91034f226685af7633ff692de3aea4798cb3dddecc6b055a7601")
  9. if is_plat("windows", "mingw") then
  10. add_syslinks("ole32", "shell32", "uuid")
  11. end
  12. add_deps("cmake")
  13. on_install(function (package)
  14. local configs = {"-DPLATFORMFOLDERS_BUILD_TESTING=OFF"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. if package:is_plat("windows") and package:config("shared") then
  18. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  19. end
  20. import("package.tools.cmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:check_cxxsnippets({test = [[
  24. void test() {
  25. sago::getConfigHome();
  26. }
  27. ]]}, {configs = {languages = "c++11"}, includes = "sago/platform_folders.h"}))
  28. end)