Skia and missing ICU symbols.

186 views
Skip to first unread message

justin drury

unread,
Jan 11, 2022, 2:48:55 PM1/11/22
to skia-discuss
I just began implementing Skia into my macOS app.  I wanted SkParagraph to be built, so my relative arguments into gn were...  skia_use_system_icu=false, skia_use_harfbuzz=true, skia_use_icu=true.

Now my app makes also use of ICU functions, here's just a quick excerpt...

UDateFormat* df = udat_open(UDAT_SHORT, UDAT_SHORT, NULL, NULL, 0, NULL, 0, &status);
        jassert(status==U_ZERO_ERROR);
        int32_t parsepos=0;
        UDate myDate = udat_parse(df, icuDateTime.getString(), icuDateTime.getLength(), &parsepos, &status);
        if (status==U_ZERO_ERROR)

When that happens the linker complains about missing ICU symbols.  nm the skia static libs shows the symbols as being Undefined..   Scouring third_party/icu/icu.gni b/third_party/icu/icu.gni  I saw a bunch of missing .cpp files.  I don't know if there's a reason for them to be missing, but adding them fixed my linker issues...

Here's just a few...
+  "$_src/i18n/double-conversion-double-to-string.cpp",
+  "$_src/i18n/double-conversion-double-to-string.h",
+  "$_src/i18n/formatted_string_builder.cpp",
+  "$_src/i18n/formattedval_iterimpl.cpp",
+  "$_src/i18n/formattedval_sbimpl.cpp",
+  "$_src/i18n/formatted_string_builder.h",
+  "$_src/i18n/formattedvalue.cpp",

Is this something that's just an oversight?  Would someone want a diff to add the missing files, or are they omitted for a reason?

Cheers

Justin



Ben Wagner

unread,
Jan 11, 2022, 3:19:43 PM1/11/22
to skia-d...@googlegroups.com
Skia itself neither needs nor wants these files in its own build of
ICU. Any BUILD files in Skia's third_party directory should be
considered as building those libraries for Skia specifically (for
example used for testing or for bundling with Skia in a CanvasKit
build). They often aren't built for general use or the way they would
be built for a distribution. If your app needs ICU, you should either
build it yourself (and modify Skia's build to look for it wherever you
build it), or use the system ICU (skia_use_system_icu=true). ICU is
particularly interesting this way, as there are many subsets of ICU
(and its data files) which can be built depending on which parts are
needed. Also, Skia's FreeType build is particularly interesting and
doesn't build everything. Also, the versions of the projects in Skia's
third_party are quite uneven, some are updated often and to arbitrary
commits and some are rather old. You'll probably want to control for
that.
> --
> You received this message because you are subscribed to the Google Groups "skia-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/3c4fa103-f4cb-4bfa-8483-43536394dd1an%40googlegroups.com.

justin drury

unread,
Jan 11, 2022, 3:28:11 PM1/11/22
to skia-discuss
That makes a lot of sense, thanks!
Reply all
Reply to author
Forward
0 new messages