mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 20:07:01 +00:00
7ff13f4ee1
(otherwise if another loader such as Glew is accessible, the opengl3 backend might automatically use it). [#2919, #2798]
76 lines
1.8 KiB
Makefile
76 lines
1.8 KiB
Makefile
#
|
|
# Cross Platform Makefile
|
|
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
|
#
|
|
|
|
EXE = example_null
|
|
EXTRA_WARNINGS ?= 0
|
|
UNITY_BUILD ?= 0
|
|
ifeq ($(UNITY_BUILD), 1)
|
|
SOURCES = unity_build.cpp
|
|
else
|
|
SOURCES = main.cpp
|
|
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
|
|
endif
|
|
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
CXXFLAGS += -I../ -I../../
|
|
CXXFLAGS += -g -Wall -Wformat
|
|
LIBS =
|
|
|
|
# We use the EXTRA_WARNINGS flag on our CI setup to eagerly catch zealous warnings
|
|
ifeq ($(EXTRA_WARNINGS), 1)
|
|
CXXFLAGS += -Wno-zero-as-null-pointer-constant -Wno-double-promotion -Wno-variadic-macros
|
|
endif
|
|
|
|
##---------------------------------------------------------------------
|
|
## BUILD FLAGS PER PLATFORM
|
|
##---------------------------------------------------------------------
|
|
|
|
ifeq ($(UNAME_S), Linux) #LINUX
|
|
ECHO_MESSAGE = "Linux"
|
|
ifneq ($(EXTRA_WARNINGS), 0)
|
|
CXXFLAGS += -Wextra -pedantic
|
|
endif
|
|
CFLAGS = $(CXXFLAGS)
|
|
endif
|
|
|
|
ifeq ($(UNAME_S), Darwin) #APPLE
|
|
ECHO_MESSAGE = "Mac OS X"
|
|
ifneq ($(EXTRA_WARNINGS), 0)
|
|
CXXFLAGS += -Weverything -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-padded -Wno-c++11-long-long
|
|
endif
|
|
CFLAGS = $(CXXFLAGS)
|
|
endif
|
|
|
|
ifeq ($(findstring MINGW,$(UNAME_S)),MINGW)
|
|
ECHO_MESSAGE = "MinGW"
|
|
ifneq ($(EXTRA_WARNINGS), 0)
|
|
CXXFLAGS += -Wextra -pedantic
|
|
endif
|
|
CFLAGS = $(CXXFLAGS)
|
|
endif
|
|
|
|
##---------------------------------------------------------------------
|
|
## BUILD RULES
|
|
##---------------------------------------------------------------------
|
|
|
|
%.o:%.cpp
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
%.o:../%.cpp
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
%.o:../../%.cpp
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
all: $(EXE)
|
|
@echo Build complete for $(ECHO_MESSAGE)
|
|
|
|
$(EXE): $(OBJS)
|
|
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
|
|
|
|
clean:
|
|
rm -f $(EXE) $(OBJS)
|