mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Fix window build with Makefile
the problem is that sdl2-config --libs apparently includes shit that's only useful for the executable, but not dlls, like linking against SDL2main and libmingw32 and setting -mwindows Furthermore I forgot to add -lopengl32 and -shared to the ref_gl Windows LDFLAGS.
This commit is contained in:
parent
7f27c549a8
commit
4ede163794
1 changed files with 8 additions and 2 deletions
10
Makefile
10
Makefile
|
@ -390,7 +390,7 @@ ifeq ($(WITH_SDL2),yes)
|
|||
release/quake2.exe : CFLAGS += -DSDL2
|
||||
endif
|
||||
|
||||
release/quake2.exe : LDFLAGS += -mwindows -lopengl32
|
||||
release/quake2.exe : LDFLAGS += -mwindows
|
||||
|
||||
else # not Windows
|
||||
|
||||
|
@ -530,6 +530,12 @@ ifeq ($(WITH_SDL2),yes)
|
|||
release/ref_gl.dll : CFLAGS += -DSDL2
|
||||
endif
|
||||
|
||||
release/ref_gl.dll : LDFLAGS += -lopengl32 -shared
|
||||
|
||||
# don't want the dll to link against libSDL2main or libmingw32, and no -mwindows either
|
||||
# that's for the .exe only
|
||||
DLL_SDLLDFLAGS = $(subst -mwindows,,$(subst -lmingw32,,$(subst -lSDL2main,,$(SDLLDFLAGS))))
|
||||
|
||||
else ifeq ($(OSTYPE), Darwin)
|
||||
|
||||
ref_gl:
|
||||
|
@ -875,7 +881,7 @@ endif
|
|||
ifeq ($(OSTYPE), Windows)
|
||||
release/ref_gl.dll : $(REFGL_OBJS)
|
||||
@echo "===> LD $@"
|
||||
${Q}$(CC) $(REFGL_OBJS) $(LDFLAGS) $(SDLLDFLAGS) -o $@
|
||||
${Q}$(CC) $(REFGL_OBJS) $(LDFLAGS) $(DLL_SDLLDFLAGS) -o $@
|
||||
$(Q)strip $@
|
||||
else ifeq ($(OSTYPE), Darwin)
|
||||
release/ref_gl.dylib : $(REFGL_OBJS)
|
||||
|
|
Loading…
Reference in a new issue