-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.lua
46 lines (44 loc) · 1.17 KB
/
setup.lua
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
-- Function to read .env file and return a table of key-value pairs
local function read_env_file(filepath)
local env = {}
for line in io.lines(filepath) do
local key, value = line:match("^([^=]+)=(.*)$")
if key and value then
env[tostring(key)] = tostring(value)
end
end
return env
end
-- Read the .env file
local env = read_env_file(".env")
lc_options = {
cuda_backend = true,
dx_backend = true,
enable_dsl = true,
enable_gui = true,
vk_support = true,
lc_xrepo_dir = env.LC_XREPO_DIR,
cpu_backend = false,
metal_backend = false,
enable_mimalloc = false,
enable_custom_malloc = false,
enable_api = false,
enable_clangcxx = false,
enable_osl = false,
enable_ir = false,
enable_tests = false,
external_marl = false,
dx_cuda_interop = false,
lc_backend_lto = false,
sdk_dir = "\"\"",
}
local file = io.open("lc_options.generated.lua", "w")
file:write("lc_dir = ")
file:write(env.LC_DIR)
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()