Use freetype

This commit is contained in:
blankie 2023-01-22 12:16:40 +07:00
parent d5b1840606
commit 7f47dfe1e5
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 12 additions and 7 deletions

View File

@ -18,7 +18,8 @@ EXE = logmeow
IMGUI_DIR = imgui
SOURCES = $(wildcard *.cpp)
SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp
SOURCES += $(IMGUI_DIR)/misc/cpp/imgui_stdlib.cpp $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
SOURCES += $(IMGUI_DIR)/misc/cpp/imgui_stdlib.cpp $(IMGUI_DIR)/misc/freetype/imgui_freetype.cpp
SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s)
LINUX_GL_LIBS = -lGL
@ -46,25 +47,25 @@ LIBS =
##---------------------------------------------------------------------
ifeq ($(UNAME_S), Linux) #LINUX
LIBS += $(LINUX_GL_LIBS) -ldl `sdl2-config --libs` -lfontconfig -lpcre2-8 -lpcre2-posix
LIBS += $(LINUX_GL_LIBS) -ldl `sdl2-config --libs` `pkg-config --libs freetype2 fontconfig` -lpcre2-8 -lpcre2-posix
CXXFLAGS += `sdl2-config --cflags` -DUSE_FONTCONFIG
CXXFLAGS += `sdl2-config --cflags` `pkg-config --cflags freetype2` -DUSE_FONTCONFIG
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), Darwin) #APPLE
LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` -lpcre2-8 -lpcre2-posix
LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` `pkg-config --libs freetype2` -lpcre2-8 -lpcre2-posix
LIBS += -L/usr/local/lib -L/opt/local/lib
CXXFLAGS += `sdl2-config --cflags`
CXXFLAGS += `sdl2-config --cflags` `pkg-config --cflags freetype2`
CXXFLAGS += -I/usr/local/include -I/opt/local/include
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(OS), Windows_NT)
LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` -lpcre2-8 -lpcre2-posix
LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2 freetype2` -lpcre2-8 -lpcre2-posix
CXXFLAGS += `pkg-config --cflags sdl2`
CXXFLAGS += `pkg-config --cflags sdl2 freetype2`
CFLAGS = $(CXXFLAGS)
endif
@ -85,6 +86,9 @@ $(EXE): $(OBJS)
%.o:$(IMGUI_DIR)/misc/cpp/%.cpp
$(CXX) $(CXXFLAGS) -Wno-conversion -c -o $@ $<
%.o:$(IMGUI_DIR)/misc/freetype/%.cpp
$(CXX) $(CXXFLAGS) -Wno-conversion -c -o $@ $<
%.o:$(IMGUI_DIR)/backends/%.cpp
$(CXX) $(CXXFLAGS) -Wno-conversion -c -o $@ $<

View File

@ -4,6 +4,7 @@
#define IM_ASSERT_USER_ERROR(expr,msg) do { if (!(expr)) { log(msg); } } while (0);
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
#define IMGUI_ENABLE_FREETYPE
#ifndef NDEBUG
#define IMGUI_DEBUG_PARANOID