xmake.lua 1.3 KB

123456789101112131415161718192021222324252627
  1. package("aurora-au")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://aurora-opensource.github.io/au")
  4. set_description("A C++14-compatible physical units library with no dependencies and a single-file delivery option. Emphasis on safety, accessibility, performance, and developer experience.")
  5. set_license("Apache-2.0")
  6. set_urls("https://github.com/aurora-opensource/au/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/aurora-opensource/au.git")
  8. add_versions("0.4.1", "5e88a0ffcb0a0843f4bd4d4ea4429c793f85dfcb8c1e7f7978de6fecab739b84")
  9. add_deps("cmake")
  10. on_install(function (package)
  11. local configs = {"-DAU_ENABLE_TESTING=OFF", "-DAU_EXCLUDE_GTEST_DEPENDENCY=ON"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:check_cxxsnippets({test = [[
  18. void test() {
  19. constexpr auto length = au::meters(100.0);
  20. }
  21. ]]}, {configs = {languages = "c++14"}, includes = "au/units/meters.hh"}))
  22. end)