From d05595e9453f2286d27611f2fa8d352d5194f372 Mon Sep 17 00:00:00 2001 From: Patrick Dawson Date: Sat, 20 Jan 2024 07:38:01 +0100 Subject: [PATCH] update SConstruct --- gdext/SConstruct | 27 ++++++++++++++++----------- gdext/src/ImGuiGD.cpp | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/gdext/SConstruct b/gdext/SConstruct index 8b828d7..745261f 100644 --- a/gdext/SConstruct +++ b/gdext/SConstruct @@ -1,25 +1,17 @@ #!/usr/bin/env python from glob import glob from pathlib import Path +import shutil +import subprocess env = SConscript("godot-cpp/SConstruct") env.Append(CPPDEFINES=['IMGUI_USER_CONFIG="\\"imconfig-godot.h\\""', "IGN_EXPORT"]) env.Append(CPPPATH=["src/", "imgui/", "include/", "gen/"]) env.Replace(CXXFLAGS=str(env["CXXFLAGS"]).replace("c++17", "c++20")) -sources = Glob("src/*.cpp") + Glob("imgui/*.cpp") + Glob("gen/*.cpp") - -(extension_path,) = glob("proj/addons/*/*.gdextension") -addon_path = Path(extension_path).parent -project_name = Path(extension_path).stem - -config = "release" if env["target"] == "template_release" else "debug" - -libpath = env.get("LIBPATH", []) -libs = [env["LIBS"]] - windows = env["platform"] == "windows" linux = env["platform"] == "linux" +config = "release" if env["target"] == "template_release" else "debug" if config == "release": if windows: @@ -30,8 +22,21 @@ if windows: elif linux: triplet = "x64-linux" else: + subprocess.call("zsh vcpkg-macos.sh", shell=True) triplet = "arm64-osx" +subprocess.call("python gds_bindings.py", shell=True) + +sources = Glob("src/*.cpp") + Glob("imgui/*.cpp") + Glob("gen/*.cpp") + +shutil.copy("imgui-godot-native.gdextension", "../addons/imgui-godot/") +(extension_path,) = glob("../addons/imgui-godot/*.gdextension") +addon_path = Path(extension_path).parent +project_name = Path(extension_path).stem + +libpath = env.get("LIBPATH", []) +libs = [env["LIBS"]] + env.Append(CPPPATH=["imgui/misc/freetype/"]) env.Append(CPPPATH=[f"vcpkg_installed/{triplet}/include"]) env.Append(CPPDEFINES=["IMGUI_ENABLE_FREETYPE"]) #, "IMGUI_ENABLE_FREETYPE_LUNASVG"]) diff --git a/gdext/src/ImGuiGD.cpp b/gdext/src/ImGuiGD.cpp index 1d28fd5..c63bba6 100644 --- a/gdext/src/ImGuiGD.cpp +++ b/gdext/src/ImGuiGD.cpp @@ -144,7 +144,7 @@ PackedInt64Array ImGuiGD::GetImGuiPtrs(String version, int ioSize, int vertSize, if (version != String(ImGui::GetVersion()) || ioSize != sizeof(ImGuiIO) || vertSize != sizeof(ImDrawVert) || idxSize != sizeof(ImDrawIdx) || charSize != sizeof(ImWchar)) { - UtilityFunctions::push_error("ImGui version mismatch, use ", ImGui::GetVersion(), "-docking"); + UtilityFunctions::push_error("ImGui version mismatch, use v", ImGui::GetVersion(), "-docking"); return {}; }