Merge pull request #497 from jwdeitch/master

fix compiling error on OSX (-lglfw3 not found)
This commit is contained in:
Micha Mettke 2017-09-18 17:41:54 +02:00 committed by GitHub
commit 48f659abd8
2 changed files with 6 additions and 4 deletions

View File

@ -12,10 +12,11 @@ BIN := $(BIN).exe
LIBS = -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32 LIBS = -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32
else else
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
GLFW3 := $(shell pkg-config --libs glfw3)
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
LIBS := -lglfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib LIBS := $(GLFW3) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib
else else
LIBS = -lglfw -lGL -lm -lGLU -lGLEW LIBS = $(GLFW3) -lGL -lm -lGLU -lGLEW
endif endif
endif endif

View File

@ -7,11 +7,12 @@ BIN := $(BIN).exe
LIBS := -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32 LIBS := -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32
else else
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
GLFW3 := $(shell pkg-config --libs glfw3)
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
LIBS := -lglfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib LIBS := $(GLFW3) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib
CFLAGS += -I/usr/local/include CFLAGS += -I/usr/local/include
else else
LIBS := -lglfw -lGL -lm -lGLU -lGLEW LIBS := $(GLFW3) -lGL -lm -lGLU -lGLEW
endif endif
endif endif