From 6276f65be4f07c80bf3e2f2adafe2dd426f52d52 Mon Sep 17 00:00:00 2001 From: Martin Lisowski Date: Tue, 14 Jan 2025 21:15:22 +0100 Subject: [PATCH] Enable building config_editor in Windows MSYS platform --- util/build.c | 5 ++++- util/config_editor.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/util/build.c b/util/build.c index 9a13bfb..7f141a1 100644 --- a/util/build.c +++ b/util/build.c @@ -1145,8 +1145,11 @@ void DoCommand(const char *l) { BUILD_UTILITY("font_editor", "-lX11 -Wno-unused-parameter", ""); CallSystem("bin/font_editor res/Fonts/Bitmap\\ Sans\\ Regular\\ 9.font"); } else if (0 == strcmp(l, "config")) { +#ifdef __MSYS__ + BUILD_UTILITY("config_editor", "-Wl,-subsystem,windows -Wno-unused-parameter -mwindows", ""); +#else BUILD_UTILITY("config_editor", "-lX11 -Wno-unused-parameter", ""); - +#endif if (CallSystem("bin/config_editor")) { printf("The config editor could not be opened.\n" "This likely means your system does not have X11 setup.\n" diff --git a/util/config_editor.c b/util/config_editor.c index 7e822a7..daf2f69 100644 --- a/util/config_editor.c +++ b/util/config_editor.c @@ -7,7 +7,11 @@ #include +#ifdef __MSYS__ +#define UI_WINDOWS +#else #define UI_LINUX +#endif #define UI_IMPLEMENTATION #include "luigi.h"