Skip to content

Commit 95d774c

Browse files
CMake: Ensure libunicode's version is correct at configure time
Signed-off-by: Christian Parpart <[email protected]>
1 parent 89a217c commit 95d774c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cmake/ContourThirdParties.cmake

+9-4
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,17 @@ else()
125125
set(THIRDPARTY_BUILTIN_freetype "system package")
126126
endif()
127127

128-
find_package(libunicode QUIET)
129-
if(libunicode_FOUND)
130-
set(THIRDPARTY_BUILTIN_unicode_core "system package (${libunicode_VERSION})")
131-
else()
128+
set(LIBUNICODE_MINIMAL_VERSION "0.4.0")
129+
if(COMMAND ContourThirdParties_Embed_libunicode)
132130
ContourThirdParties_Embed_libunicode()
131+
subproject_version(libunicode libunicode_version)
132+
if(NOT DEFINED libunicode_version OR libunicode_version VERSION_LESS LIBUNICODE_MINIMAL_VERSION)
133+
message(FATAL_ERROR "Embedded libunicode version must be at least ${LIBUNICODE_MINIMAL_VERSION}, but found ${libunicode_version}")
134+
endif()
133135
set(THIRDPARTY_BUILTIN_unicode_core "embedded")
136+
else()
137+
find_package(libunicode ${LIBUNICODE_MINIMAL_VERSION} REQUIRED)
138+
set(THIRDPARTY_BUILTIN_unicode_core "system package (${libunicode_VERSION})")
134139
endif()
135140

136141
if(LIBTERMINAL_BUILD_BENCH_HEADLESS)

0 commit comments

Comments
 (0)