xmake.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package("turbobase64")
  2. set_homepage("https://github.com/powturbo/Turbo-Base64")
  3. set_description("Turbo Base64 - Fastest Base64 SIMD/Neon/Altivec")
  4. set_license("GPL-3.0")
  5. add_urls("https://github.com/powturbo/Turbo-Base64.git")
  6. add_versions("2022.02.21", "cf6e4f2f7fbe7fc5fe780fdf1cc4d1aa609fc46e")
  7. -- CMake build support and patch is from https://github.com/powturbo/Turbo-Base64/pull/14
  8. add_patches("2022.02.21", path.join(os.scriptdir(), "patches", "2022.02.21", "header.patch"), "0458a4eaf2b4f5429fcd7755ad8637240cb05081d2ab0531e41ed52ef1e8a477")
  9. add_configs("ncheck", {description = "Dinsable for checking for more fast decoding", default = false, type = "boolean"})
  10. add_configs("fullcheck", {description = "Enable full base64 checking", default = false, type = "boolean"})
  11. add_configs("avx512", {description = "Enable AVX512", default = false, type = "boolean"})
  12. add_deps("cmake")
  13. on_install("linux", "macos", "windows", function (package)
  14. os.cp(path.join(package:scriptdir(), "port/*"), ".")
  15. local configs = {
  16. "-DBUILD_TESTS=OFF",
  17. }
  18. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  19. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  20. table.insert(configs, "-DNCHECK=" .. (package:config("nocheck") and "ON" or "OFF"))
  21. table.insert(configs, "-DFULLCHECK=" .. (package:config("fullcheck") and "ON" or "OFF"))
  22. table.insert(configs, "-DUSE_AVX512=" .. (package:config("avx512") and "ON" or "OFF"))
  23. import("package.tools.cmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("tb64ini", {includes = "turbobase64/turbob64.h"}))
  27. end)