xmake.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package("stdexec")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/NVIDIA/stdexec")
  4. set_description("`std::execution`, the proposed C++ framework for asynchronous and parallel programming. ")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/NVIDIA/stdexec.git")
  7. add_versions("2024.12.08", "26d8565bc7660b4fb8b504e00cac6b0419ffa939")
  8. add_versions("2024.03.08", "b3ba13a7b8c206371207196e08844fb7bc745438")
  9. set_policy("package.cmake_generator.ninja", false)
  10. add_deps("cmake")
  11. if on_check then
  12. on_check("windows", function (package)
  13. import("core.base.semver")
  14. local vs_toolset = package:toolchain("msvc"):config("vs_toolset")
  15. assert(vs_toolset and semver.new(vs_toolset):minor() >= 30, "package(stdexec): need vs_toolset >= v143")
  16. end)
  17. end
  18. on_install("windows", "linux", "macosx", "mingw", "msys", function (package)
  19. if package:has_tool("cxx", "cl") then
  20. package:add("cxxflags", "/Zc:__cplusplus", "/Zc:preprocessor")
  21. end
  22. local configs = {"-DSTDEXEC_BUILD_EXAMPLES=OFF", "-DSTDEXEC_BUILD_TESTS=OFF"}
  23. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  24. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  25. import("package.tools.cmake").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cxxincludes("exec/static_thread_pool.hpp", {configs = {languages = "c++20"}}))
  29. end)