xmake.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package("eastl")
  2. set_homepage("https://github.com/electronicarts/EASTL")
  3. set_description("EASTL stands for Electronic Arts Standard Template Library.")
  4. set_license("BSD-3-Clause")
  5. set_urls("https://github.com/electronicarts/EASTL/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/electronicarts/EASTL.git")
  7. add_versions("3.17.03", "50a072066e30fda364d482df6733572d8ca440a33825d81254b59a6ca9f4375a")
  8. add_versions("3.17.06", "9ebeef26cdf091877ee348450d2711cd0bb60ae435309126c0adf8fec9a01ea5")
  9. add_versions("3.18.00", "a3c5b970684be02e81fb16fbf92ed2584e055898704fde87c72d0331afdea12b")
  10. add_versions("3.21.12", "2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e")
  11. add_deps("cmake")
  12. add_deps("eabase")
  13. on_install("windows", "linux", "macosx", function (package)
  14. io.replace("CMakeLists.txt", "add_subdirectory(test/packages/EABase)", "", {plain = true})
  15. io.replace("CMakeLists.txt", "target_link_libraries(EASTL EABase)", "", {plain = true})
  16. local configs = {"-DEASTL_BUILD_TESTS=OFF", "-DEASTL_BUILD_BENCHMARK=OFF"}
  17. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  18. if not package:is_plat("windows") then
  19. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  20. end
  21. import("package.tools.cmake").install(package, configs, {packagedeps = "eabase"})
  22. os.cp("include/EASTL", package:installdir("include"))
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. void test() {
  27. eastl::vector<int> testInt{};
  28. }
  29. ]]},{configs = {languages = "c++17"}, includes = "EASTL/vector.h"}))
  30. end)