Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: sdl2+opengl3: fixes for Makefile #2774

Merged
merged 2 commits into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/example_glfw_opengl3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ CXXFLAGS += -I../libs/gl3w

## Using OpenGL loader: glew
## (This assumes a system-wide installation)
# CXXFLAGS = -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW
# CXXFLAGS += -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW

## Using OpenGL loader: glad
## (You'll also need to change the rule at line ~77 of this Makefile to compile/link glad.c/.o)
# SOURCES += ../libs/glad/src/glad.c
# CXXFLAGS = -I../libs/glad/include -DIMGUI_IMPL_OPENGL_LOADER_GLAD
# CXXFLAGS += -I../libs/glad/include -DIMGUI_IMPL_OPENGL_LOADER_GLAD

##---------------------------------------------------------------------
## BUILD FLAGS PER PLATFORM
Expand Down Expand Up @@ -87,7 +86,9 @@ endif
$(CXX) $(CXXFLAGS) -c -o $@ $<

%.o:../libs/gl3w/GL/%.c
# %.o:../libs/glad/src/%.c
$(CC) $(CFLAGS) -c -o $@ $<

%.o:../libs/glad/src/%.c
$(CC) $(CFLAGS) -c -o $@ $<

all: $(EXE)
Expand Down
14 changes: 8 additions & 6 deletions examples/example_sdl_opengl3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ CXXFLAGS += -I../libs/gl3w

## Using OpenGL loader: glew
## (This assumes a system-wide installation)
# CXXFLAGS = -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW
# CXXFLAGS += -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW

## Using OpenGL loader: glad
## (You'll also need to change the rule at line ~77 of this Makefile to compile/link glad.c/.o)
# SOURCES += ../libs/glad/src/glad.c
# CXXFLAGS = -I../libs/glad/include -DIMGUI_IMPL_OPENGL_LOADER_GLAD
# CXXFLAGS += -I../libs/glad/include -DIMGUI_IMPL_OPENGL_LOADER_GLAD

##---------------------------------------------------------------------
## BUILD FLAGS PER PLATFORM
Expand All @@ -50,7 +49,7 @@ ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
LIBS += -lGL -ldl `sdl2-config --libs`

CXXFLAGS += -I../libs/gl3w `sdl2-config --cflags`
CXXFLAGS += `sdl2-config --cflags`
CFLAGS = $(CXXFLAGS)
endif

Expand All @@ -59,7 +58,7 @@ ifeq ($(UNAME_S), Darwin) #APPLE
LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs`
LIBS += -L/usr/local/lib -L/opt/local/lib

CXXFLAGS += -I../libs/gl3w `sdl2-config --cflags`
CXXFLAGS += `sdl2-config --cflags`
CXXFLAGS += -I/usr/local/include -I/opt/local/include
CFLAGS = $(CXXFLAGS)
endif
Expand All @@ -68,7 +67,7 @@ ifeq ($(findstring MINGW,$(UNAME_S)),MINGW)
ECHO_MESSAGE = "MinGW"
LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2`

CXXFLAGS += -I../libs/gl3w `pkg-config --cflags sdl2`
CXXFLAGS += `pkg-config --cflags sdl2`
CFLAGS = $(CXXFLAGS)
endif

Expand All @@ -88,6 +87,9 @@ endif
%.o:../libs/gl3w/GL/%.c
$(CC) $(CFLAGS) -c -o $@ $<

%.o:../libs/glad/src/%.c
$(CC) $(CFLAGS) -c -o $@ $<

all: $(EXE)
@echo Build complete for $(ECHO_MESSAGE)

Expand Down