From 14ac085df634e76224ca8c21af3dbda74f7d4b40 Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 21 Mar 2024 23:41:15 +0800 Subject: [PATCH] imgui: fix sdl config (#3577) --- packages/i/imgui/xmake.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/i/imgui/xmake.lua b/packages/i/imgui/xmake.lua index 798540455..d8245097e 100644 --- a/packages/i/imgui/xmake.lua +++ b/packages/i/imgui/xmake.lua @@ -158,8 +158,10 @@ package("imgui") on_test(function (package) if package:config("user_config") ~= nil then return end local includes = {"imgui.h"} + local defines if package:config("sdl2_renderer") or package:config("sdl2_no_renderer") then table.insert(includes, "SDL.h") + defines = "SDL_MAIN_HANDLED" end assert(package:check_cxxsnippets({test = [[ void test() { @@ -172,5 +174,5 @@ package("imgui") ImGui::Render(); ImGui::DestroyContext(); } - ]]}, {configs = {languages = "c++14"}, includes = includes})) + ]]}, {configs = {languages = "c++11", defines = defines}, includes = includes})) end)