Skip to content

Commit 3b3da73

Browse files
authored
Merge pull request #2 from DMsuDev/refactor/restructure
Fixed USE_CONSOLE libraries
2 parents 98d6819 + 675e0cd commit 3b3da73

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

β€Žexamples/ImGui/makefileβ€Ž

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ CXX := g++
6363
ARCH ?= native
6464

6565
# Show console window on Windows? (set to false for GUI-only apps)
66-
USE_CONSOLE ?= false
66+
USE_CONSOLE ?= true
6767

6868
# Optimization levels
6969
OPT_RELEASE ?= -O3
@@ -109,7 +109,7 @@ endif
109109
ifeq ($(OS),Windows_NT)
110110
OS_NAME := Windows
111111
ifeq ($(USE_CONSOLE),false)
112-
CONSOLEFLAGS := -mwindows -luser32
112+
CONSOLEFLAGS := -mwindows
113113
endif
114114

115115
# Choose command style depending on shell (PowerShell vs cmd)
@@ -154,13 +154,10 @@ LDFLAGS := -L./lib/
154154

155155
LIBS := -ld3d12 -ldxgi -ld3dcompiler
156156

157-
CONSOLEFLAGS ?=
158-
SANITIZERS ?=
159-
160157
# === Platform-specific libraries ===
161158
ifeq ($(OS),Windows_NT)
162159
# Windows / MinGW common
163-
LIBS += -luser32 -lkernel32 -lshell32 -ldwmapi
160+
LIBS += -lkernel32 -luser32 -lgdi32 -lshell32 -ldwmapi
164161
endif
165162

166163
ifeq ($(OS_NAME),Linux)
@@ -203,7 +200,13 @@ DEPFLAGS = -MT $@ -MMD -MP -MF $(DEP_DIR)/$*.d
203200
# ──────────────────────────────────────────────────────────────────────────────
204201

205202
.PHONY: all dirs
203+
ifeq ($(words $(SOURCES)),0)
204+
all: clean-banner
205+
@printf "\n$(WARN_COLOR)No source files found. Nothing to build.$(NO_COLOR)\n"
206+
@exit 0
207+
else
206208
all: clean-banner dirs $(BIN_DIR)/$(TARGET)
209+
endif
207210

208211
dirs:
209212
@$(MKDIR) "$(call FIXPATH,$(BIN_DIR))"

β€Žtemplates/advanced/makefileβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ endif
109109
ifeq ($(OS),Windows_NT)
110110
OS_NAME := Windows
111111
ifeq ($(USE_CONSOLE),false)
112-
CONSOLEFLAGS := -mwindows -luser32
112+
CONSOLEFLAGS := -mwindows
113113
endif
114114

115115
# Choose command style depending on shell (PowerShell vs cmd)
@@ -157,7 +157,7 @@ LIBS :=
157157
# === Platform-specific libraries ===
158158
ifeq ($(OS),Windows_NT)
159159
# Windows / MinGW common
160-
LIBS += -luser32 -lkernel32 -lshell32 -ldwmapi
160+
LIBS += -lkernel32 -luser32 -lgdi32 -lshell32 -ldwmapi
161161
endif
162162

163163
ifeq ($(OS_NAME),Linux)

0 commit comments

Comments
Β (0)