-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
51 lines (45 loc) · 2.2 KB
/
Copy pathxmake.lua
File metadata and controls
51 lines (45 loc) · 2.2 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
add_rules("mode.debug", "mode.release", "mode.releasedbg")
add_rules("plugin.vsxmake.autoupdate")
set_runtimes(is_mode("debug") and "MDd" or "MD")
function add_files_to_target(p, hpp_as_files, install)
for _, dir in ipairs(os.filedirs(p)) do
local relative_dir = path.relative(dir, path.join(os.projectdir(), "Src"))
if os.isdir(dir) then
add_files(path.join("$(projectdir)", "Src", relative_dir, "**.cpp"))
if hpp_as_files then
add_files(path.join("$(projectdir)", "Src", relative_dir, "**.hpp"))
end
add_files(path.join("$(projectdir)", "Src", relative_dir, "*.refl.hpp"))
local should_install = path.basename(dir) ~= "Private"
add_headerfiles(path.join("$(projectdir)", "Src", "(" .. relative_dir .. "/*.hpp)"), {install = should_install})
add_headerfiles(path.join("$(projectdir)", "Src", "(" .. relative_dir .. "/*.inl)"), {install = should_install})
else
local ext = path.extension(relative_dir)
if ext == ".hpp" or ext == ".inl" then
add_headerfiles(path.join("$(projectdir)", "Src", "(" .. relative_dir .. ")"), {install = install})
elseif ext == ".cpp" then
add_files(path.join("$(projectdir)", "Src", relative_dir))
end
end
end
end
option("reflection", { description = "Enable C++ reflection system", default = false })
option("profiling", { description = "Build with tracy profiler", default = false })
option("graphics", { description = "Build graphics", default = false })
includes("Xmake/**.lua")
includes("Xmake/Rules/**.lua")
includes("Src/Concerto/Core/xmake.lua")
includes("Src/Concerto/Profiler/xmake.lua")
if has_config("graphics") then
includes("Src/Concerto/Graphics/xmake.lua")
includes("Examples/Graphics/xmake.lua")
end
if has_config("reflection") then
includes("Src/Concerto/HeaderPlugin/xmake.lua")
includes("Src/Concerto/CppPlugin/xmake.lua")
includes("Src/Concerto/TsPlugin/xmake.lua")
includes("Src/Concerto/JsonPlugin/xmake.lua")
includes("Src/Concerto/PackageGenerator/xmake.lua")
includes("Src/Concerto/Reflection/xmake.lua")
end
includes("Tests/xmake.lua")