Skip to content

Commit ac5ffff

Browse files
rokupsocornut
authored andcommitted
CI: Test builds with freetype on linux.
1 parent bdd31ec commit ac5ffff

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
- name: Install Dependencies
167167
run: |
168168
sudo apt-get update
169-
sudo apt-get install -y libglfw3-dev libsdl2-dev gcc-multilib g++-multilib
169+
sudo apt-get install -y libglfw3-dev libsdl2-dev gcc-multilib g++-multilib libfreetype6-dev
170170
171171
- name: Build example_null (extra warnings, gcc 32-bit)
172172
run: |
@@ -188,6 +188,11 @@ jobs:
188188
make -C examples/example_null clean
189189
CXXFLAGS="$CXXFLAGS -m64 -Werror" CXX=clang++ make -C examples/example_null EXTRA_WARNINGS=1
190190
191+
- name: Build example_null (freetype)
192+
run: |
193+
make -C examples/example_null clean
194+
make -C examples/example_null WITH_FREETYPE=1
195+
191196
- name: Build example_null (single file build)
192197
run: |
193198
echo '#define IMGUI_IMPLEMENTATION' > example_single_file.cpp

examples/example_null/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
EXE = example_null
77
EXTRA_WARNINGS ?= 0
8+
WITH_FREETYPE ?= 0
89
SOURCES = main.cpp
910
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
1011
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
@@ -19,6 +20,13 @@ ifeq ($(EXTRA_WARNINGS), 1)
1920
CXXFLAGS += -Wno-zero-as-null-pointer-constant -Wno-double-promotion -Wno-variadic-macros
2021
endif
2122

23+
# We use the WITH_FREETYPE flag on our CI setup to test misc/freetype/imgui_freetype.cpp font rasterizer
24+
ifeq ($(WITH_FREETYPE), 1)
25+
SOURCES += ../../misc/freetype/imgui_freetype.cpp
26+
CXXFLAGS += $(shell pkg-config --cflags freetype2)
27+
LIBS += $(shell pkg-config --libs freetype2)
28+
endif
29+
2230
##---------------------------------------------------------------------
2331
## BUILD FLAGS PER PLATFORM
2432
##---------------------------------------------------------------------
@@ -60,6 +68,9 @@ endif
6068
%.o:../../%.cpp
6169
$(CXX) $(CXXFLAGS) -c -o $@ $<
6270

71+
%.o:../../misc/freetype/%.cpp
72+
$(CXX) $(CXXFLAGS) -c -o $@ $<
73+
6374
all: $(EXE)
6475
@echo Build complete for $(ECHO_MESSAGE)
6576

0 commit comments

Comments
 (0)