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
|
add_rules("mode.debug", "mode.release")
-- add_requires("vulkansdk", "glfw", "fmt", "vulkan-memory-allocator", "spdlog", "glm")
-- Project settings
set_project("iris_renderer")
set_version("1.0")
set_languages("c++20")
-- Project directories
local project_root = os.projectdir()
local src_dir = path.join(project_root, "src")
local ext_dir = path.join(project_root, "ext")
-- ImGui target
target("imgui")
set_kind("static")
local imgui_dir = path.join(ext_dir, "imgui")
-- Add source files
add_files(
path.join(imgui_dir, "imgui.cpp"),
path.join(imgui_dir, "imgui_demo.cpp"),
path.join(imgui_dir, "imgui_draw.cpp"),
path.join(imgui_dir, "imgui_tables.cpp"),
path.join(imgui_dir, "imgui_widgets.cpp"),
path.join(imgui_dir, "backends/imgui_impl_glfw.cpp"),
path.join(imgui_dir, "backends/imgui_impl_vulkan.cpp")
)
if is_host("windows") then
add_packages("vulkansdk", "glfw")
end
-- Add include directories
add_includedirs(
imgui_dir,
path.join(imgui_dir, "backends"),
{public = true}
)
-- Arguments for compilation
target("argparse")
set_kind("headeronly")
add_includedirs(path.join(ext_dir, "argparse/include"), {public = true})
target("tinygltf")
set_kind("headeronly")
add_includedirs(path.join(ext_dir, "tinygltf.git"), {public = true})
add_cxxflags("-w")
target("tinyobjloader")
set_kind("headeronly")
add_includedirs(path.join(ext_dir, "tinyobjloader"), {public = true})
target("stb")
set_kind("headeronly")
add_includedirs(path.join(ext_dir, "stb"), {public = true})
target("glm")
set_kind("headeronly")
add_includedirs(path.join(ext_dir, "glm"), {public = true})
-- Main executable target
target("iris_renderer")
set_kind("binary")
add_files(path.join(src_dir, "**.cpp"))
-- Link external libraries
add_deps("argparse", "imgui", "tinygltf", "tinyobjloader", "stb", "glm")
-- Add libraries
add_packages("vulkansdk", "glfw", "fmt", "vulkan-memory-allocator", "spdlog", "glm")
-- OS-specific libraries (dl, pthread, X11, etc.)
if is_plat("linux") then
add_syslinks("vulkan", "glfw", "fmt")
add_syslinks("dl", "pthread", "X11", "Xxf86vm", "Xrandr", "Xi")
end
-- Compiler options
add_cxxflags("-Wall", "-Wextra", "-Wno-missing-field-initializers")
-- Vulkan validation layers for debug builds
if is_mode("debug") then
add_defines("USE_VULKAN_VALIDATION_LAYERS")
end
|