From 6a8065fcdb6cf5095499fdbd33bd3167d5783442 Mon Sep 17 00:00:00 2001 From: Sebastian Neusser Date: Fri, 18 Mar 2022 12:54:42 +0100 Subject: [PATCH 1/2] built new executable using the windows subsystem - use the raylua_r to build executables without the console window --- .gitignore | 3 ++- makefile | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3f71b1f..c99b251 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,11 @@ *.res *.a raylua_e.exe +raylua_r.exe raylua_s.exe raylua_s raylua_e src/autogen/bind.c src/autogen/boot.c src/autogen/builder.c -libraylua.a \ No newline at end of file +libraylua.a diff --git a/makefile b/makefile index d7ff55b..161b3e3 100644 --- a/makefile +++ b/makefile @@ -15,7 +15,7 @@ MODULES := raymath rlgl easings gestures physac raygui PLATFORM ?= PLATFORM_DESKTOP GRAPHICS ?= GRAPHICS_API_OPENGL_33 -CFLAGS += -D$(GRAPHICS) +CFLAGS += -D$(GRAPHICS) -D$(PLATFORM) USE_WAYLAND_DISPLAY ?= FALSE USE_EXTERNAL_GLFW ?= FALSE @@ -38,7 +38,7 @@ else EXTERNAL_FILES := endif -all: raylua_s raylua_e luajit raylib +all: raylua_s raylua_e raylua_r luajit raylib %.o: %.c $(CC) -c -o $@ $< $(CFLAGS) @@ -63,6 +63,10 @@ raylua_e: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o $(EXTERNAL_FILES) libraylua.a $(CC) -o $@ $^ $(LDFLAGS) luajit/src/libluajit.a +raylua_r: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o \ + $(EXTERNAL_FILES) libraylua.a + $(CC) -o $@ $^ $(LDFLAGS) -mwindows luajit/src/libluajit.a + src/res/icon.res: src/res/icon.rc $(WINDRES) $^ -O coff $@ From 2b37b77a71a87db458157f6beb53410b0536de19 Mon Sep 17 00:00:00 2001 From: Sebastian Neusser Date: Fri, 18 Mar 2022 13:03:06 +0100 Subject: [PATCH 2/2] only use -mwindows on windows --- makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 161b3e3..8526ec5 100644 --- a/makefile +++ b/makefile @@ -22,6 +22,7 @@ USE_EXTERNAL_GLFW ?= FALSE ifeq ($(OS),Windows_NT) LDFLAGS += -lopengl32 -lgdi32 -lwinmm -static + LDFLAGS_R += -mwindows EXTERNAL_FILES := src/res/icon.res else ifeq ($(shell uname),Darwin) LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa \ @@ -65,7 +66,7 @@ raylua_e: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o raylua_r: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o \ $(EXTERNAL_FILES) libraylua.a - $(CC) -o $@ $^ $(LDFLAGS) -mwindows luajit/src/libluajit.a + $(CC) -o $@ $^ $(LDFLAGS) $(LDFLAGS_R) luajit/src/libluajit.a src/res/icon.res: src/res/icon.rc $(WINDRES) $^ -O coff $@