-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.lua
More file actions
50 lines (47 loc) · 1.48 KB
/
setup.lua
File metadata and controls
50 lines (47 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function main(lc_path, qt_path)
if type(lc_path) ~= "string" or not os.exists(lc_path) then
utils.error("LuisaCompute path illegal.")
return
end
if type(qt_path) ~= "string" or not os.exists(qt_path) then
utils.error("QT path illegal.")
return
end
local lc_options = {
lc_cuda_backend = true,
lc_dx_backend = true,
lc_vk_backend = true,
lc_enable_dsl = true,
lc_enable_gui = true,
lc_metal_backend = false,
lc_enable_mimalloc = true,
lc_enable_custom_malloc = false,
lc_enable_unity_build = true,
lc_enable_simd = true,
lc_enable_api = false,
lc_enable_clangcxx = false,
lc_enable_osl = false,
lc_enable_ir = false,
lc_enable_tests = false,
lc_external_marl = false,
lc_dx_cuda_interop = false,
lc_backend_lto = false
}
-- write sdk-dir
lc_path = lc_path:gsub('\\', '/')
qt_path = qt_path:gsub('\\', '/')
lc_options.lc_sdk_dir = "'" .. path.join(lc_path, "SDKs"):gsub('\\', '/') .. "'"
local file = io.open("lc_options.generated.lua", "w")
file:write("lc_dir = '")
file:write(lc_path)
file:write("'\n")
file:write("qt_path = '")
file:write(qt_path)
file:write("'\n")
file:write("lc_options = {\n")
for key, value in pairs(lc_options) do
file:write(" " .. key .. " = " .. tostring(value) .. ",\n")
end
file:write("}\n")
file:close()
end