Skip to content

Commit d951fbd

Browse files
authored
imgui learned a wgpu config (#2562)
1 parent a12e2d8 commit d951fbd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

packages/i/imgui/port/xmake.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ option("sdl2", {showmenu = true, default = false})
1313
option("sdl2_renderer", {showmenu = true, default = false})
1414
option("vulkan", {showmenu = true, default = false})
1515
option("win32", {showmenu = true, default = false})
16+
option("wgpu", {showmenu = true, default = false})
1617
option("freetype", {showmenu = true, default = false})
1718
option("user_config", {showmenu = true, default = nil, type = "string"})
1819
option("wchar32", {showmenu = true, default = false})
@@ -35,6 +36,10 @@ if has_config("vulkan") then
3536
add_requires("vulkansdk")
3637
end
3738

39+
if has_config("wgpu") then
40+
add_requires("wgpu-native")
41+
end
42+
3843
if has_config("freetype") then
3944
add_requires("freetype")
4045
end
@@ -119,6 +124,12 @@ target("imgui")
119124
add_files("backends/imgui_impl_win32.cpp")
120125
add_headerfiles("(backends/imgui_impl_win32.h)")
121126
end
127+
128+
if has_config("wgpu") then
129+
add_files("backends/imgui_impl_wgpu.cpp")
130+
add_headerfiles("(backends/imgui_impl_wgpu.h)")
131+
add_packages("wgpu-native")
132+
end
122133

123134
if has_config("freetype") then
124135
add_files("misc/freetype/imgui_freetype.cpp")

packages/i/imgui/xmake.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ package("imgui")
4949
add_configs("sdl2_renderer", {description = "Enable the sdl2 renderer backend", default = false, type = "boolean"})
5050
add_configs("vulkan", {description = "Enable the vulkan backend", default = false, type = "boolean"})
5151
add_configs("win32", {description = "Enable the win32 backend", default = false, type = "boolean"})
52+
add_configs("wgpu", {description = "Enable the wgpu backend", default = false, type = "boolean"})
5253
add_configs("freetype", {description = "Use FreeType to build and rasterize the font atlas", default = false, type = "boolean"})
5354
add_configs("user_config", {description = "Use user config (disables test!)", default = nil, type = "string"})
5455
add_configs("wchar32", {description = "Use 32-bit for ImWchar (default is 16-bit)", default = false, type = "boolean"})
@@ -101,6 +102,9 @@ package("imgui")
101102
if package:config("vulkan") then
102103
package:add("deps", "vulkansdk")
103104
end
105+
if package:config("wgpu") then
106+
package:add("deps", "wgpu-native")
107+
end
104108
if package:config("freetype") then
105109
package:add("deps", "freetype")
106110
end
@@ -123,6 +127,7 @@ package("imgui")
123127
sdl2_renderer = package:config("sdl2_renderer"),
124128
vulkan = package:config("vulkan"),
125129
win32 = package:config("win32"),
130+
wgpu = package:config("wgpu"),
126131
freetype = package:config("freetype"),
127132
user_config = package:config("user_config"),
128133
wchar32 = package:config("wchar32")

0 commit comments

Comments
 (0)