Browse Source

Merge pull request #497 from jwdeitch/master

fix compiling error on OSX (-lglfw3 not found)
Micha Mettke 8 years ago
parent
commit
48f659abd8
2 changed files with 6 additions and 4 deletions
  1. 3 2
      demo/glfw_opengl3/Makefile
  2. 3 2
      example/Makefile

+ 3 - 2
demo/glfw_opengl3/Makefile

@@ -12,10 +12,11 @@ BIN := $(BIN).exe
 LIBS = -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32
 else
 	UNAME_S := $(shell uname -s)
+	GLFW3 := $(shell pkg-config --libs glfw3)
 	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
-		LIBS = -lglfw -lGL -lm -lGLU -lGLEW
+		LIBS = $(GLFW3) -lGL -lm -lGLU -lGLEW
 	endif
 endif
 

+ 3 - 2
example/Makefile

@@ -7,11 +7,12 @@ BIN := $(BIN).exe
 	LIBS := -lglfw3 -lopengl32 -lm -lGLU32 -lGLEW32
 else
 	UNAME_S := $(shell uname -s)
+	GLFW3 := $(shell pkg-config --libs glfw3)
 	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
 	else
-		LIBS := -lglfw -lGL -lm -lGLU -lGLEW
+		LIBS := $(GLFW3) -lGL -lm -lGLU -lGLEW
 	endif
 endif