Skip to content

Commit

Permalink
imgui: fix sdl test (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
63enjoy authored Jan 2, 2024
1 parent d3a9f77 commit 221fcd8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/i/imgui/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ package("imgui")
end)

on_test(function (package)
local user_config = package:config("user_config")
assert(user_config ~= nil or package:check_cxxsnippets({test = [[
if package:config("user_config") ~= nil then return end
local includes = {"imgui.h"}
if package:config("sdl2_renderer") or package:config("sdl2_no_renderer") then
table.insert(includes, "SDL.h")
end
assert(package:check_cxxsnippets({test = [[
void test() {
IMGUI_CHECKVERSION();
ImGui::CreateContext();
Expand All @@ -156,5 +160,5 @@ package("imgui")
ImGui::Render();
ImGui::DestroyContext();
}
]]}, {configs = {languages = "c++11"}, includes = {"imgui.h"}}))
]]}, {configs = {languages = "c++11"}, includes = includes}))
end)

0 comments on commit 221fcd8

Please sign in to comment.