xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829
  1. package("oboe")
  2. set_homepage("https://github.com/google/oboe")
  3. set_description("Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/google/oboe/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/google/oboe.git")
  7. add_versions("1.9.3", "9d2486b74bd396d9d9112625077d5eb656fd6942392dc25ebf222b184ff4eb61")
  8. add_deps("cmake")
  9. on_install("android", function (package)
  10. io.replace("CMakeLists.txt", "LIBRARY DESTINATION lib/${ANDROID_ABI}", "LIBRARY DESTINATION lib", {plain = true})
  11. io.replace("CMakeLists.txt", "ARCHIVE DESTINATION lib/${ANDROID_ABI}", "ARCHIVE DESTINATION lib", {plain = true})
  12. local configs = {}
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  14. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. void test() {
  20. oboe::FifoBuffer * buf = new oboe::FifoBuffer(4, 10240);
  21. auto bytes = buf->convertFramesToBytes(32);
  22. }
  23. ]]}, {configs = {languages = "c++17"}, includes = "oboe/Oboe.h"}))
  24. end)