Repository navigation
Expand file tree
/
Copy pathxmake.lua
More file actions
152 lines (140 loc) · 5.94 KB
/
Copy pathxmake.lua
File metadata and controls
152 lines (140 loc) · 5.94 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
includes("third_party/luajit")
add_rules("mode.debug", "mode.release")
add_requires("capstone", "fmt", "freetype", "libcurl", "libsdl3", "libuv", "zlib")
-- Only four of ffmpeg's libraries are used, and asking for "ffmpeg" wholesale
-- never resolves to the system copy: that package requires all eight pkg-config
-- modules, and libpostproc is GPL-only and so isn't packaged on Ubuntu at all.
-- The result is ffmpeg getting built from source on every clean checkout. These
-- are the same four names the Makefile's PACKAGES already asks for.
add_requires("pkgconfig::libavcodec", "pkgconfig::libavformat",
"pkgconfig::libavutil", "pkgconfig::libswresample")
set_languages("c++26")
target("thorvg", function()
set_kind("static")
local dir = "third_party/thorvg/src/"
add_files(
dir .. "common/*.cpp",
dir .. "renderer/*.cpp",
dir .. "renderer/cpu_engine/*.cpp",
dir .. "renderer/gpu_engine/*.cpp",
dir .. "renderer/gpu_engine/gl/*.cpp",
dir .. "loaders/svg/*.cpp",
dir .. "loaders/png/*.cpp",
dir .. "loaders/jpg/*.cpp",
dir .. "loaders/lottie/*.cpp",
dir .. "loaders/sfnt/*.cpp",
dir .. "loaders/raw/*.cpp",
dir .. "bindings/capi/tvgCapi.cpp",
"third_party/thorvg-config/tvgGlLoader.cpp",
nil
)
-- Replaced by third_party/thorvg-config/tvgGlLoader.cpp, which includes it.
remove_files(dir .. "renderer/gpu_engine/gl/tvgGl.cpp")
add_includedirs("third_party/thorvg-config", "third_party/thorvg/inc")
for _, sub in ipairs({ "common", "renderer", "renderer/cpu_engine", "renderer/gpu_engine",
"renderer/gpu_engine/gl", "loaders/svg", "loaders/png", "loaders/jpg",
"loaders/lottie", "loaders/sfnt", "loaders/raw", "bindings/capi" }) do
add_includedirs(dir .. sub)
end
add_defines("THORVG_GL_TARGET_GL=1")
add_defines("TVG_STATIC=1", { public = true })
end)
-- FTXUI: compiled from its sources, no CMake. The *_test.cpp / *_fuzzer.cpp
-- files need gtest / libFuzzer and are not part of the library. component/loop.cpp
-- is a leftover upstream no longer builds: Loop now lives in component/app.cpp.
target("ftxui", function()
set_kind("static")
add_files("third_party/ftxui/src/**.cpp")
remove_files("third_party/ftxui/src/**_test.cpp", "third_party/ftxui/src/**_fuzzer.cpp",
"third_party/ftxui/src/ftxui/component/loop.cpp")
add_includedirs("third_party/ftxui/src")
add_includedirs("third_party/ftxui/include", { public = true })
if is_plat("windows") then
add_defines("UNICODE", "_UNICODE")
end
end)
target("pcsx-redux", function()
add_includedirs(
".",
"src",
"third_party",
"third_party/ELFIO",
"third_party/gl3w",
"third_party/imgui",
"third_party/imgui/backends",
"third_party/imgui/misc/cpp",
"third_party/llhttp",
"third_party/luajit/src",
"third_party/luv/src",
"third_party/luv/deps/lua-compat-5.3/c-api",
"third_party/magic_enum/include",
"third_party/md4c/src",
"third_party/multipart-parser-c",
"third_party/PEGTL/include",
"third_party/tracy/public",
"third_party/ucl",
"third_party/ucl/include",
"third_party/uriparser/include",
"third_party/xbyak/xbyak",
"third_party/zep/extensions",
"third_party/zep/include",
nil
)
add_files("third_party/imgui/*.cpp", { cxxflags = "-include src/forced-includes/imgui.h" })
add_files("third_party/implot/*.cpp", { cxxflags = "-include src/forced-includes/implot.h" })
add_deps("luajit", "thorvg", "ftxui")
add_packages("capstone", "fmt", "freetype", "libcurl", "libsdl3", "libuv", "zlib",
"pkgconfig::libavcodec", "pkgconfig::libavformat",
"pkgconfig::libavutil", "pkgconfig::libswresample")
add_files(
"src/**/*.cc",
"third_party/cq/reclaimer.cc",
"third_party/clip/clip.cpp",
"third_party/clip/image.cpp",
"third_party/cueparser/*.c",
"third_party/gl3w/GL/gl3w.c",
"third_party/gl3w/GL/gl3w-throwers.cc",
"third_party/iec-60908b/*.c",
"third_party/ImFileDialog/ImFileDialog.cpp",
"third_party/imgui/backends/imgui_impl_opengl3.cpp",
"third_party/imgui/backends/imgui_impl_sdl3.cpp",
"third_party/imgui/misc/cpp/imgui_stdlib.cpp",
"third_party/imgui/misc/freetype/imgui_freetype.cpp",
"third_party/imgui_lua_bindings/imgui_lua_bindings.cpp",
"third_party/imgui_md/imgui_md.cpp",
"third_party/imgui_memory_editor/imgui_memory_editor.cpp",
"third_party/llhttp/*.c",
"third_party/lpeg/*.c",
"third_party/lua-protobuf/pb.c",
"third_party/luafilesystem/src/lfs.c",
"third_party/luv/src/luv.c",
"third_party/md4c/src/md4c.c",
"third_party/multipart-parser-c/multipart_parser.c",
"third_party/ucl/src/n2e_99.c",
"third_party/ucl/src/n2e_ds.c",
"third_party/ucl/src/alloc.c",
"third_party/uriparser/src/*.c",
"third_party/zep/extensions/repl/mode_repl.cpp",
"third_party/zep/src/*.cpp",
"third_party/zep/src/mcommon/animation/timer.cpp",
"third_party/zep/src/mcommon/file/path.cpp",
"third_party/zep/src/mcommon/string/stringutils.cpp",
nil
)
-- src/mips is the nugget submodule, built by its own toolchain.
remove_files("src/mips/**")
add_defines(
"IMGUI_IMPL_OPENGL_LOADER_GL3W",
"IMGUI_ENABLE_FREETYPE",
"PB_STATIC_API",
"ZEP_FEATURE_CPP_FILE_SYSTEM",
nil
)
if is_plat("macosx") then
add_files("src/main/complain.mm", "third_party/clip/clip_osx.mm")
add_frameworks("GLUT", "OpenGL", "CoreFoundation", "Cocoa")
else
add_files("third_party/clip/clip_x11.cpp")
add_ldflags("-lstdc++fs", "-lGL", "-lX11", "-lxcb")
end
end)