Skip to content

Commit 2248b5d

Browse files
dos1SiegeLord
authored andcommitted
cmake: fix static linking ttf addon dependencies when there's circular dependency between freetype and harfbuzz
1 parent 96099b9 commit 2248b5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ if(SUPPORT_FONT AND WANT_TTF)
112112
endif()
113113

114114
if (FREETYPE_HARFBUZZ AND HARFBUZZ_FOUND)
115-
list(APPEND FREETYPE_STATIC_LIBRARIES "${HARFBUZZ_LIBRARIES}")
115+
# there's a circular dependency between Harfbuzz and Freetype, so one of them has to be
116+
# repeated to ensure proper static linking order
117+
list(APPEND FREETYPE_STATIC_LIBRARIES "${HARFBUZZ_LIBRARIES}" "${FREETYPE_LIBRARIES}")
116118
endif()
117119

118120
set(CMAKE_REQUIRED_LIBRARIES ${FREETYPE_STATIC_LIBRARIES})

0 commit comments

Comments
 (0)