|
| 1 | +-- Usage |
| 2 | +--[[ |
| 3 | + add_requires("luisa-compute") |
| 4 | +
|
| 5 | + set_languages("c++20") |
| 6 | +
|
| 7 | + target("test") |
| 8 | + set_kind("binary") |
| 9 | + add_files("src/main.cpp") |
| 10 | + add_packages("luisa-compute") |
| 11 | +
|
| 12 | + on_config(function (target) |
| 13 | + -- Context require a path to find backend shared libraries |
| 14 | + -- Context context{argv[1]}; |
| 15 | + target:add("runargs", path.join(target:pkg("luisa-compute"):installdir(), "bin")) |
| 16 | + -- -- Use target:targetdir() path |
| 17 | + -- -- Context context{argv[0]}; |
| 18 | + -- os.vcp(path.join(target:pkg("luisa-compute"):installdir(), "bin/*.dll"), target:targetdir()) |
| 19 | + end) |
| 20 | +--]] |
| 21 | + |
1 | 22 | package("luisa-compute") |
2 | 23 | set_homepage("https://luisa-render.com/") |
3 | 24 | set_description("High-Performance Rendering Framework on Stream Architectures") |
4 | 25 | set_license("Apache-2.0") |
5 | 26 |
|
6 | | - add_urls("https://github.com/LuisaGroup/LuisaCompute.git") |
7 | | - add_versions("2025.09.17", "2fc3ff3efaa792ac68fa8a5877f976ad8de5773d") |
| 27 | + add_urls("https://github.com/LuisaGroup/LuisaCompute.git", {submodules = false}) |
| 28 | + add_versions("2025.09.19", "5a1cbcc861ba413e6243e70e19bb188f3388302d") |
8 | 29 |
|
9 | 30 | add_configs("cuda", {description = "Enable CUDA backend", default = false, type = "boolean"}) |
10 | 31 | add_configs("vulkan", {description = "Enable Vulkan backend", default = false, type = "boolean"}) |
@@ -42,7 +63,7 @@ package("luisa-compute") |
42 | 63 |
|
43 | 64 | add_deps("cmake", "pkgconf") |
44 | 65 | add_deps("spdlog", {configs = {header_only = false, fmt_external = true}}) |
45 | | - add_deps("lmdb", "reproc", "xxhash", "yyjson", "magic_enum", "marl") |
| 66 | + add_deps("lmdb", "reproc", "xxhash", "yyjson", "magic_enum", "marl", "stb") -- TODO: half |
46 | 67 |
|
47 | 68 | on_check(function (package) |
48 | 69 | assert(package:is_arch64(), "package(luisa-compute) only support 64 bit") |
@@ -81,12 +102,23 @@ package("luisa-compute") |
81 | 102 | table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
82 | 103 | table.insert(configs, "-DLUISA_COMPUTE_ENABLE_LTO=" .. (package:config("lto") and "ON" or "OFF")) |
83 | 104 | table.insert(configs, "-DLUISA_COMPUTE_ENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) |
| 105 | + if package:is_plat("windows") and package:is_debug() then |
| 106 | + -- xmake default flags will break unity build |
| 107 | + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=") |
| 108 | + end |
84 | 109 |
|
85 | 110 | table.insert(configs, "-DLUISA_COMPUTE_ENABLE_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) |
86 | 111 | table.insert(configs, "-DLUISA_COMPUTE_ENABLE_VULKAN=" .. (package:config("vulkan") and "ON" or "OFF")) |
87 | 112 | table.insert(configs, "-DLUISA_COMPUTE_ENABLE_CPU=" .. (package:config("cpu") and "ON" or "OFF")) |
88 | 113 | table.insert(configs, "-DLUISA_COMPUTE_ENABLE_GUI=" .. (package:config("gui") and "ON" or "OFF")) |
| 114 | + |
| 115 | + os.vcp(package:dep("stb"):installdir("include/stb"), "src/ext/stb/") |
89 | 116 | import("package.tools.cmake").install(package, configs) |
| 117 | + |
| 118 | + if package:is_plat("windows") and package:is_debug() then |
| 119 | + local dir = package.builddir and package:builddir() or package:buildir() |
| 120 | + os.vcp(path.join(dir, "lib/*.pdb"), package:installdir("bin")) |
| 121 | + end |
90 | 122 | end) |
91 | 123 |
|
92 | 124 | on_test(function (package) |
|
0 commit comments