Skip to content

Commit 5af8a3d

Browse files
committed
fix: Harmonize Windows build configuration with Linux/macOS
- Align Windows build variables with other platforms - Fix duplicate CXXFLAGS and directory definitions - Add missing FFmpeg libraries to Windows build - Use consistent variable names across platforms - Add proper linker configuration for Windows
1 parent 81f2759 commit 5af8a3d

1 file changed

Lines changed: 15 additions & 26 deletions

File tree

source/makefile

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,56 +52,45 @@ ifneq (,$(findstring MINGW,$(MSYSTEM)))
5252
# Windows (MSYS2/MinGW) configuration
5353
PLATFORM = windows
5454
BUILD_TYPE = Windows (SDL2/MinGW)
55-
else ifneq (,$(findstring MINGW,$(shell uname -s)))
56-
# Windows (MSYS2/MinGW) configuration through other environments
57-
PLATFORM = windows
58-
BUILD_TYPE = Windows (SDL2/MinGW)
5955
ARCH_FLAGS =
6056

6157
# Windows-specific paths and flags
6258
MINGW_PATH = /mingw64
6359
HOMEBREW_PATH = $(MINGW_PATH)
6460

65-
# Output directories
66-
OBJ_DIR = ../builds/obj_windows
67-
BIN_DIR = ../builds/binaries
68-
TARGET = $(BIN_DIR)/TapeXPlayer.exe
69-
7061
# Disable macOS-specific settings
7162
BUILD_INFO_SWIFT =
7263
SWIFT_TARGET =
64+
USE_SWIFT = no
7365

7466
# Windows compilation flags
75-
CXXFLAGS = -std=c++23 -Wall -Wextra -O2 -g -msse2 -msse4.1 -mavx -mavx2 -Wno-unused-parameter
76-
INCLUDES = -I$(MINGW_PATH)/include -I$(MINGW_PATH)/include/SDL2 \
77-
-Imodules/FSTPMainModule -Imodules/FSTPMainModule/WSGUI \
78-
-Imodules/FSTPPlayerModule -Imodules/FSTPVideoModule \
79-
-I$(MINGW_PATH)/include/ffmpeg
80-
LDFLAGS = -L$(MINGW_PATH)/lib
81-
LIBS = -lSDL2 -lportaudio -lwinmm -lole32 -lgdi32
67+
CXXFLAGS = -std=c++23 -Wall -Wextra -O2 -g \
68+
-msse2 -msse4.1 -mavx -mavx2 \
69+
-Wno-unused-parameter
8270

8371
# Include paths
8472
INCLUDES = -I$(MINGW_PATH)/include \
8573
-I$(MINGW_PATH)/include/SDL2 \
8674
-Imodules/FSTPMainModule \
8775
-Imodules/FSTPMainModule/WSGUI \
8876
-Imodules/FSTPPlayerModule \
89-
-Imodules/FSTPVideoModule
77+
-Imodules/FSTPVideoModule \
78+
-I$(MINGW_PATH)/include/ffmpeg
9079

91-
# Compiler flags
92-
CXXFLAGS = -std=c++23 -Wall -Wextra -O2 -g \
93-
-msse2 -msse4.1 -mavx -mavx2 \
94-
-Wno-unused-parameter \
95-
$(INCLUDES)
80+
# Add includes to CXXFLAGS
81+
CXXFLAGS += $(INCLUDES)
9682

9783
# Library paths and libs
9884
LDFLAGS = -L$(MINGW_PATH)/lib
99-
LIBS = -lSDL2 -lportaudio -lwinmm -lole32 -lgdi32
85+
LIBS = -lSDL2 -lportaudio -lavformat -lavcodec -lavutil -lswscale \
86+
-lwinmm -lole32 -lgdi32
10087

10188
# Output directories
102-
OBJ_DIR = ../builds/obj_windows
103-
BIN_DIR = ../builds/binaries
104-
TARGET = $(BIN_DIR)/TapeXPlayer.exe
89+
OBJDIR = ../builds/obj_windows
90+
TARGET = ../builds/binaries/TapeXPlayer.exe
91+
92+
# Use g++ as linker
93+
LINKER = $(CXX)
10594

10695
else ifeq ($(UNAME_S),Linux)
10796
# Linux - no architecture flags needed for g++

0 commit comments

Comments
 (0)