generated from Pixfri/TemplateCppProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmake.lua
80 lines (59 loc) · 2.02 KB
/
xmake.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
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
set_xmakever("2.9.3")
ProjectName = "FlashlightEngine"
set_project(ProjectName)
add_rules("mode.debug", "mode.release")
option("override_runtime", {description = "Override VS runtime to MD in release and MDd in debug.", default = true})
option("force_validation", {description = "Force Vulkan validation layers to be enabled.", default = false})
option("profiler", {description = "Enable the Tracy profiler.", default = false})
add_includedirs("Include")
add_rules("plugin.vsxmake.autoupdate")
if is_mode("release") then
set_fpmodels("fast")
set_optimize("fastest")
set_symbols("hidden")
else
add_defines("FL_DEBUG")
set_symbols("debug")
end
set_encodings("utf-8")
set_exceptions("cxx")
set_languages("cxx23")
set_rundir("./bin/$(plat)_$(arch)_$(mode)")
set_targetdir("./bin/$(plat)_$(arch)_$(mode)")
set_warnings("allextra")
set_allowedplats("windows", "mingw")
if is_plat("windows") then
if has_config("override_runtime") then
set_runtimes(is_mode("debug") and "MDd" or "MD")
end
end
if has_config("force_validation") then
add_defines("FL_FORCE_DX_DEBUG_INTERFACE")
end
add_cxflags("-Wno-missing-field-initializers -Werror=vla", {tools = {"clang", "gcc"}})
add_requires("freeimage", "stb", "glfw 3.4", "spdlog")
add_requires("imgui", {configs = {dx11 = true, glfw = true}})
add_requires("directxmath", "directxtex")
if has_config("profiler") then
add_defines("FL_PROFILER_ENABLED")
add_requires("tracy")
end
rule("cp-resources")
after_build(function(target)
os.cp("Resources", "./bin/$(plat)_$(arch)_$(mode)/")
end)
target(ProjectName)
set_kind("binary")
add_rules("cp-resources")
add_files("Source/**.cpp")
for _, ext in ipairs({".hpp", ".inl"}) do
add_headerfiles("Include/**" .. ext)
end
add_packages("freeimage", "stb", "glfw", "spdlog", "imgui")
add_packages("directxmath", "directxtex")
if has_config("profiler") then
add_packages("tracy")
end
add_syslinks("d3d11", "user32", "kernel32", "dxgi", "dxguid", "WinMM", "d3dcompiler")
add_rpathdirs("$ORIGIN")
includes("xmake/**.lua")