-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathimgui.mak
63 lines (50 loc) · 1.8 KB
/
imgui.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
IMGUI_CTE_SRC = ImGuiColorTextEdit
IMGUI_CTE_OBJ = obj/$(IMGUI_CTE_SRC)
IMGUI_SRC = imgui
IMGUI_OBJ = obj/$(IMGUI_SRC)
ifeq ($(RELEASE),1)
CFLAGS += -DIMGUI_DISABLE_DEMO_WINDOWS=1 -DIMGUI_DISABLE_METRICS_WINDOW=1
endif
##---------------------------------------------------------------------
## BUILD FLAGS PER PLATFORM
##---------------------------------------------------------------------
CFLAGS += -I$(IMGUI_SRC) -I$(IMGUI_SRC)/examples -I$(IMGUI_SRC)/examples/libs/gl3w -DIMGUI_IMPL_OPENGL_LOADER_GL3W -I$(IMGUI_CTE_SRC)
LDFLAGS_IMGUI =
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
LDFLAGS_IMGUI += -lGL `pkg-config --static --libs glfw3`
CFLAGS += `pkg-config --cflags glfw3`
endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
LDFLAGS_IMGUI += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
LDFLAGS_IMGUI += -L/usr/local/lib -L/opt/local/lib
#LDFLAGS_IMGUI += -lglfw3
LDFLAGS_IMGUI += -lglfw
CFLAGS += -I/usr/local/include -I/opt/local/include
endif
ifeq ($(OS),Windows_NT)
ECHO_MESSAGE = "MinGW"
LDFLAGS_IMGUI += -Wl,-Bstatic -lglfw3 -Wl,-Bdynamic -lgdi32 -lopengl32 -limm32
CFLAGS += `pkg-config --cflags glfw3`
endif
IMGUI_OBJS = \
$(IMGUI_OBJ)/imgui.o \
$(IMGUI_OBJ)/imgui_demo.o \
$(IMGUI_OBJ)/imgui_draw.o \
$(IMGUI_OBJ)/imgui_widgets.o \
$(IMGUI_OBJ)/examples/imgui_impl_glfw.o \
$(IMGUI_OBJ)/examples/imgui_impl_opengl3.o \
$(IMGUI_OBJ)/examples/libs/gl3w/GL/gl3w.o \
$(IMGUI_OBJ)/addons/imguifilesystem/imguifilesystem.o
IMGUI_CTE_OBJS = \
$(IMGUI_CTE_OBJ)/TextEditor.o \
$(IMGUI_CTE_OBJ)/%.o: $(IMGUI_CTE_SRC)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MMD -c $< -o $@
$(IMGUI_OBJ)/%.o: $(IMGUI_SRC)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MMD -c $< -o $@
$(IMGUI_OBJ)/%.o: $(IMGUI_SRC)/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -MMD -c $< -o $@