Merge pull request #130 from coltongit/patch-11

Fix compilation for MXE on Linux and WSL
This commit is contained in:
fgsfds 2020-05-16 21:05:55 +03:00 committed by GitHub
commit efadc481ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,8 +47,6 @@ else
endif endif
# Automatic settings for PC port(s) # Automatic settings for PC port(s)
# WINDOWS_BUILD IS NOT FOR COMPILING A WINDOWS EXECUTABLE UNDER LINUX OR WSL!
# USE THE WIKI GUIDE WITH MSYS2 FOR COMPILING A WINDOWS EXECUTABLE!
NON_MATCHING := 1 NON_MATCHING := 1
GRUCODE := f3dex2e GRUCODE := f3dex2e
@ -430,9 +428,14 @@ else
LD := $(CC) LD := $(CC)
endif endif
CPP := $(CROSS)cpp -P ifeq ($(WINDOWS_BUILD),1) # fixes compilation in MXE on Linux and WSL
CPP := cpp -P
OBJCOPY := objcopy
else
CPP := $(CROSS)cpp -P
OBJCOPY := $(CROSS)objcopy
endif
OBJDUMP := $(CROSS)objdump OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
PYTHON := python3 PYTHON := python3
SDLCONFIG := $(CROSS)sdl2-config SDLCONFIG := $(CROSS)sdl2-config
@ -481,23 +484,22 @@ ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
ifeq ($(TARGET_WEB),1) ifeq ($(TARGET_WEB),1)
LDFLAGS := -lm -lGL -lSDL2 -no-pie -s TOTAL_MEMORY=20MB -g4 --source-map-base http://localhost:8080/ -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']" LDFLAGS := -lm -lGL -lSDL2 -no-pie -s TOTAL_MEMORY=20MB -g4 --source-map-base http://localhost:8080/ -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']"
else else ifeq ($(WINDOWS_BUILD),1)
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread -lglew32 `$(SDLCONFIG) --static-libs` -lm -lglu32 -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -lopengl32 -static
ifeq ($(WINDOWS_BUILD),1) ifneq ($(CROSS),i686-w64-mingw32.static-)
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread -lglew32 `$(SDLCONFIG) --static-libs` -lm -lglu32 -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -lopengl32 -no-pie -static ifneq ($(CROSS),x86_64-w64-mingw32.static-)
ifeq ($(WINDOWS_CONSOLE),1) LDFLAGS += -no-pie
LDFLAGS += -mconsole endif
endif endif
else ifeq ($(WINDOWS_CONSOLE),1)
LDFLAGS += -mconsole
endif
else ifeq ($(TARGET_RPI),1)
# Linux / Other builds below # Linux / Other builds below
ifeq ($(TARGET_RPI),1)
LDFLAGS := $(OPT_FLAGS) -lm -lGLESv2 `$(SDLCONFIG) --libs` -no-pie LDFLAGS := $(OPT_FLAGS) -lm -lGLESv2 `$(SDLCONFIG) --libs` -no-pie
else else
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm -lGL `$(SDLCONFIG) --libs` -no-pie -lpthread LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm -lGL `$(SDLCONFIG) --libs` -no-pie -lpthread
endif endif
endif
endif #Added for Pi ifeq
# Prevent a crash with -sopt # Prevent a crash with -sopt