|
|
@@ -1,10 +1,31 @@
|
|
|
+-- Usage
|
|
|
+--[[
|
|
|
+ add_requires("luisa-compute")
|
|
|
+
|
|
|
+ set_languages("c++20")
|
|
|
+
|
|
|
+ target("test")
|
|
|
+ set_kind("binary")
|
|
|
+ add_files("src/main.cpp")
|
|
|
+ add_packages("luisa-compute")
|
|
|
+
|
|
|
+ on_config(function (target)
|
|
|
+ -- Context require a path to find backend shared libraries
|
|
|
+ -- Context context{argv[1]};
|
|
|
+ target:add("runargs", path.join(target:pkg("luisa-compute"):installdir(), "bin"))
|
|
|
+ -- -- Use target:targetdir() path
|
|
|
+ -- -- Context context{argv[0]};
|
|
|
+ -- os.vcp(path.join(target:pkg("luisa-compute"):installdir(), "bin/*.dll"), target:targetdir())
|
|
|
+ end)
|
|
|
+--]]
|
|
|
+
|
|
|
package("luisa-compute")
|
|
|
set_homepage("https://luisa-render.com/")
|
|
|
set_description("High-Performance Rendering Framework on Stream Architectures")
|
|
|
set_license("Apache-2.0")
|
|
|
|
|
|
- add_urls("https://github.com/LuisaGroup/LuisaCompute.git")
|
|
|
- add_versions("2025.09.17", "2fc3ff3efaa792ac68fa8a5877f976ad8de5773d")
|
|
|
+ add_urls("https://github.com/LuisaGroup/LuisaCompute.git", {submodules = false})
|
|
|
+ add_versions("2025.09.19", "5a1cbcc861ba413e6243e70e19bb188f3388302d")
|
|
|
|
|
|
add_configs("cuda", {description = "Enable CUDA backend", default = false, type = "boolean"})
|
|
|
add_configs("vulkan", {description = "Enable Vulkan backend", default = false, type = "boolean"})
|
|
|
@@ -42,7 +63,7 @@ package("luisa-compute")
|
|
|
|
|
|
add_deps("cmake", "pkgconf")
|
|
|
add_deps("spdlog", {configs = {header_only = false, fmt_external = true}})
|
|
|
- add_deps("lmdb", "reproc", "xxhash", "yyjson", "magic_enum", "marl")
|
|
|
+ add_deps("lmdb", "reproc", "xxhash", "yyjson", "magic_enum", "marl", "stb") -- TODO: half
|
|
|
|
|
|
on_check(function (package)
|
|
|
assert(package:is_arch64(), "package(luisa-compute) only support 64 bit")
|
|
|
@@ -81,12 +102,23 @@ package("luisa-compute")
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DLUISA_COMPUTE_ENABLE_LTO=" .. (package:config("lto") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DLUISA_COMPUTE_ENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF"))
|
|
|
+ if package:is_plat("windows") and package:is_debug() then
|
|
|
+ -- xmake default flags will break unity build
|
|
|
+ table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=")
|
|
|
+ end
|
|
|
|
|
|
table.insert(configs, "-DLUISA_COMPUTE_ENABLE_CUDA=" .. (package:config("cuda") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DLUISA_COMPUTE_ENABLE_VULKAN=" .. (package:config("vulkan") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DLUISA_COMPUTE_ENABLE_CPU=" .. (package:config("cpu") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DLUISA_COMPUTE_ENABLE_GUI=" .. (package:config("gui") and "ON" or "OFF"))
|
|
|
+
|
|
|
+ os.vcp(package:dep("stb"):installdir("include/stb"), "src/ext/stb/")
|
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
+
|
|
|
+ if package:is_plat("windows") and package:is_debug() then
|
|
|
+ local dir = package.builddir and package:builddir() or package:buildir()
|
|
|
+ os.vcp(path.join(dir, "lib/*.pdb"), package:installdir("bin"))
|
|
|
+ end
|
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|