1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00

Update font/build.mk to use pkg-config to get CXXFLAGS and CXXLIBS in Linux

This commit is contained in:
Samuel Gomes 2024-01-07 06:59:34 +05:30
parent 37f24f8e48
commit 56b7ac61d3

View file

@ -1,21 +1,4 @@
ifeq ($(OS),win)
# This version is only used for Windows, Linux and macOS use the library provided by their system.
# When updating the Freetype library for Windows, simply download the latest source release, delete
# the old contents of the freetype directory and move the entire Freetype source tree into it.
FREETYPE_MAKE_FLAGS := OS=Windows_NT
FREETYPE_MAKE_FLAGS += CC=../../../../c_compiler/bin/gcc.exe
FREETYPE_MAKE_FLAGS += AR=../../../../c_compiler/bin/ar.exe
FREETYPE_LIB := $(PATH_INTERNAL_C)/parts/video/font/freetype/objs/freetype.a
$(PATH_INTERNAL_C)/parts/video/font/freetype/config.mk:
$(MAKE) -C $(PATH_INTERNAL_C)/parts/video/font/freetype -f ./Makefile $(FREETYPE_MAKE_FLAGS)
$(FREETYPE_LIB): $(PATH_INTERNAL_C)/parts/video/font/freetype/config.mk
$(MAKE) -C $(PATH_INTERNAL_C)/parts/video/font/freetype -f ./Makefile $(FREETYPE_MAKE_FLAGS)
FONT_SRCS := \
font.cpp
@ -29,6 +12,23 @@ FONT_STUB_OBJS := $(patsubst %.cpp,$(PATH_INTERNAL_C)/parts/video/font/%.o,$(FON
$(PATH_INTERNAL_C)/parts/video/font/%.o: $(PATH_INTERNAL_C)/parts/video/font/%.cpp
$(CXX) -O2 $(CXXFLAGS) -DDEPENDENCY_CONSOLE_ONLY -Wall $< -c -o $@
ifeq ($(OS),win)
# The interanal FreeType library is only used for Windows, Linux and macOS use the library provided by their system.
# When updating the Freetype library for Windows, simply download the latest source release, delete
# the old contents of the freetype2 directory and move the entire Freetype source tree into it.
FREETYPE_MAKE_FLAGS := OS=Windows_NT
FREETYPE_MAKE_FLAGS += CC=../../../../c_compiler/bin/gcc.exe
FREETYPE_MAKE_FLAGS += AR=../../../../c_compiler/bin/ar.exe
FREETYPE_LIB := $(PATH_INTERNAL_C)/parts/video/font/freetype/objs/freetype.a
$(PATH_INTERNAL_C)/parts/video/font/freetype/config.mk:
$(MAKE) -C $(PATH_INTERNAL_C)/parts/video/font/freetype -f ./Makefile $(FREETYPE_MAKE_FLAGS)
$(FREETYPE_LIB): $(PATH_INTERNAL_C)/parts/video/font/freetype/config.mk
$(MAKE) -C $(PATH_INTERNAL_C)/parts/video/font/freetype -f ./Makefile $(FREETYPE_MAKE_FLAGS)
.PHONY: clean-freetype-lib
clean-freetype-lib:
$(MAKE) -C $(PATH_INTERNAL_C)/parts/video/font/freetype -f ./Makefile $(FREETYPE_MAKE_FLAGS) distclean
@ -44,11 +44,12 @@ FREETYPE_CXXLIBS :=
else
CLEAN_LIST += $(FONT_OBJS) $(FONT_STUB_OBJS)
FREETYPE_EXE_LIBS :=
FREETYPE_CXXFLAGS :=
FREETYPE_CXXFLAGS := $(shell pkg-config --cflags freetype2)
FREETYPE_CXXLIBS :=
FREETYPE_CXXLIBS += -lfreetype
FREETYPE_CXXLIBS := $(shell pkg-config --libs freetype2)
endif