From ce302529e4fb13a371fc243a14441a97fb5c2e53 Mon Sep 17 00:00:00 2001 From: Victor Bombi Date: Tue, 14 Apr 2020 10:18:40 +0200 Subject: [PATCH] avoid error in opengl3 impl generation with extra_defines --- generator/generator.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generator/generator.lua b/generator/generator.lua index 2156728..66d26ca 100644 --- a/generator/generator.lua +++ b/generator/generator.lua @@ -644,6 +644,9 @@ if #implementations > 0 then local locati = [[imgui_impl_]].. impl local pipe,err + local define_cmd = COMPILER=="cl" and [[ /E /D]] or [[ -E -D]] + local extra_defines = "" + if impl == "opengl3" then extra_defines = define_cmd .. "IMGUI_IMPL_OPENGL_LOADER_GL3W " end local include_cmd = COMPILER=="cl" and [[ /I ]] or [[ -I ]] local extra_includes = include_cmd.." ../imgui " if config[impl] then @@ -653,7 +656,7 @@ if #implementations > 0 then end if HAVE_COMPILER then - pipe,err = io.popen(CPRE..extra_includes..source,"r") + pipe,err = io.popen(CPRE..extra_defines..extra_includes..source,"r") else pipe,err = io.open(source,"r") end