-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathxmake.lua
More file actions
138 lines (133 loc) · 5.12 KB
/
xmake.lua
File metadata and controls
138 lines (133 loc) · 5.12 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
set_xmakever("3.0.6")
add_rules("mode.release", "mode.debug", "mode.releasedbg")
set_policy("build.ccache", not is_plat("windows"))
set_policy("check.auto_ignore_flags", false)
-- pre-defined options
-- enable mimalloc as default allocator: https://github.com/LuisaGroup/mimalloc
option("lc_enable_mimalloc", {default = true})
-- enable custom memory allocator instead of default system allocator
option("lc_enable_custom_malloc", {default = false})
-- enable unity(jumbo) build, enable this option will optimize compile speed
option("lc_enable_unity_build", {default = true})
-- enable Pre-Compile header, enable this option will optimize compile speed
option("lc_enable_pch", {default = true})
-- enable sse and sse2 SIMD
option("lc_enable_simd", {default = true})
-- enable DirectX-12 backend
option("lc_dx_backend", {default = true})
-- enable fallback CPU backend for platforms without GPU support
option("lc_fallback_backend", {default = false})
-- enable XIR (Intermediate Representation) support
option("lc_enable_xir", {default = false})
-- use external Marl library instead of bundled version
option("lc_external_marl", {default = false})
-- enable DirectX-CUDA interoperability
option("lc_dx_cuda_interop", {default = false})
-- enable Vulkan-CUDA interoperability
option("lc_vk_cuda_interop", {default = false})
-- enable Link Time Optimization (LTO) for smaller binary size
option("lc_use_lto", {default=false})
-- enable Vulkan backend
option("lc_vk_backend", {default = true})
-- enable toy C backend for testing and debugging
option("lc_toy_c_backend", {default = false})
-- enable NVIDIA-CUDA backend
option("lc_cuda_backend", {default = true})
-- enable NVIDIA-CUDA Extension CUB, default false, because of long compile time
option("lc_cuda_ext_lcub", {default = false})
-- enable Metal backend
option("lc_metal_backend", {default = true})
-- enable tests module
option("lc_enable_tests", {default = true})
-- C++ standard version (e.g., cxx17, cxx20, cxx23)
option("lc_cxx_standard", {default = 'cxx20'})
-- C standard version (e.g., c11, clatest)
option("lc_c_standard", {default = 'clatest'})
-- enable C++ Run-Time Type Information (RTTI)
option("lc_rtti", {default = false})
-- Python include directory path
option("lc_py_include", {default = false})
-- Python library directory path
option("lc_py_linkdir", {default = false})
-- Python libraries to link
option("lc_py_libs", {default = false})
-- enable OpenShadingLanguage (OSL) support
option("lc_enable_osl", {default = true})
-- enable C++ DSL module
option("lc_enable_dsl", {default = true})
-- enable clang C++ module
option("lc_enable_clangcxx", {default = false})
-- enable GUI module
option("lc_enable_gui", {default = true})
-- enable ImGui integration for GUI
option("lc_enable_imgui", {default = true})
-- custom binary output directory
option("lc_bin_dir", {default = "bin"})
-- enable Python bindings
option("lc_enable_py", {default = true})
-- download and extract package dir, set to empty string to disable installation
option("lc_sdk_dir", {default = false})
-- custom toolchain path or name
option("lc_toolchain", {default = false})
-- Windows runtime library (MT/MD/MTd/MDd)
option("lc_win_runtime", {default = false})
-- additional optimization flags
option("lc_optimize", {default = false})
-- custom LLVM installation path
option("lc_llvm_path", {default = false})
-- custom Embree installation path
option("lc_embree_path", {default = false})
-- use system STL instead of bundled or custom one
option("lc_use_system_stl", {default = false})
-- third-party: use xmake-repo packages instead of bundled sources
-- use xmake-repo spdlog package instead of bundled
option("lc_spdlog_use_xrepo", {default = false})
-- use xmake-repo reproc package instead of bundled
option("lc_reproc_use_xrepo", {default = false})
-- use xmake-repo lmdb package instead of bundled
option("lc_lmdb_use_xrepo", {default = false})
-- use xmake-repo imgui package instead of bundled
option("lc_imgui_use_xrepo", {default = false})
-- use xmake-repo glfw package instead of bundled
option("lc_glfw_use_xrepo", {default = false})
-- use xmake-repo yyjson package instead of bundled
option("lc_yyjson_use_xrepo", {default = false})
-- internal: xmake scripts directory path
option("lc_scripts_path")
function lc_set_pcxxheader(...)
if get_config('lc_enable_pch') then
set_pcxxheader(...)
end
end
set_showmenu(false)
set_default(false)
after_check(function(option)
option:set_value(path.join(os.scriptdir(), 'scripts'))
end)
option_end()
-- internal: external dependencies directory path
option("lc_ext_path")
set_showmenu(false)
set_default(false)
after_check(function(option)
option:set_value(path.join(os.scriptdir(), 'src/ext'))
end)
option_end()
-- pre-defined options end
-- try options.lua
if path.absolute(os.projectdir()) == path.absolute(os.scriptdir()) and os.exists("scripts/options.lua") then
includes("scripts/options.lua")
end
if lc_options then
for k, v in pairs(lc_options) do
set_config(k, v)
end
end
includes("scripts/xmake_func.lua")
if has_config('_lc_check_env') then
local lc_bin_dir = get_config("_lc_bin_dir")
if lc_bin_dir then
set_targetdir(lc_bin_dir)
end
includes("src")
end