Skip to content

Commit

Permalink
Merge pull request #1136 from Shopify/fix/1122-icu-validation-error
Browse files Browse the repository at this point in the history
Reverted (mildly) SkParagraph/skUnicode - merging even though the build failed since we need to rebuild Skia to make the build work.
  • Loading branch information
chrfalch authored Nov 23, 2022
2 parents eb1d5ab + cd7dcfb commit 26f5ecb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
18 changes: 9 additions & 9 deletions package/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ set (PACKAGE_NAME "reactskia")
set (SKIA_LIB "skia")
set (SKIA_SVG_LIB "svg")
set (SKIA_SKSHAPER_LIB "skshaper")
set (SKIA_SKPARAGRAPH_LIB "skparagraph")
set (SKIA_SKUNICODE_LIB "skunicode")
#set (SKIA_SKPARAGRAPH_LIB "skparagraph")
#set (SKIA_SKUNICODE_LIB "skunicode")

set(build_DIR ${CMAKE_SOURCE_DIR}/build)
file(GLOB LIBRN_DIR "${PREBUILT_DIR}/${ANDROID_ABI}")
Expand Down Expand Up @@ -72,7 +72,7 @@ target_include_directories(
cpp/skia/include/utils/
cpp/skia/include/pathops/
cpp/skia/modules/
cpp/skia/modules/skparagraph/include/
#cpp/skia/modules/skparagraph/include/
cpp/skia/include/
cpp/skia

Expand Down Expand Up @@ -103,11 +103,11 @@ set_property(TARGET svg PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libsvg.a")
add_library(skshaper STATIC IMPORTED)
set_property(TARGET skshaper PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskshaper.a")

add_library(skparagraph STATIC IMPORTED)
set_property(TARGET skparagraph PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskparagraph.a")
#add_library(skparagraph STATIC IMPORTED)
#set_property(TARGET skparagraph PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskparagraph.a")

add_library(skunicode STATIC IMPORTED)
set_property(TARGET skunicode PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskunicode.a")
#add_library(skunicode STATIC IMPORTED)
#set_property(TARGET skunicode PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskunicode.a")


find_library(
Expand Down Expand Up @@ -169,8 +169,8 @@ target_link_libraries(
${TURBOMODULES_LIB}
${SKIA_SVG_LIB}
${SKIA_SKSHAPER_LIB}
${SKIA_SKPARAGRAPH_LIB}
${SKIA_SKUNICODE_LIB}
#${SKIA_SKPARAGRAPH_LIB}
#${SKIA_SKUNICODE_LIB}
${SKIA_LIB}
-ljnigraphics
-lGLESv2
Expand Down
2 changes: 0 additions & 2 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"libs/ios/libsvg.xcframework",
"libs/ios/libskottie.xcframework",
"libs/ios/libsksg.xcframework",
"libs/ios/libskparagraph.xcframework",
"libs/ios/libskunicode.xcframework",
"react-native-skia.podspec",
"scripts/install-npm.js",
"scripts/setup-canvaskit.js",
Expand Down
4 changes: 2 additions & 2 deletions package/react-native-skia.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Pod::Spec.new do |s|
'libs/ios/libskia.xcframework',
'libs/ios/libsvg.xcframework',
'libs/ios/libskshaper.xcframework',
'libs/ios/libskparagraph.xcframework',
'libs/ios/libskunicode.xcframework',
#'libs/ios/libskparagraph.xcframework',
#'libs/ios/libskunicode.xcframework',
]

# All iOS cpp/h files
Expand Down
37 changes: 28 additions & 9 deletions scripts/skia-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ import { executeCmdSync } from "./utils";

const NdkDir: string = process.env.ANDROID_NDK ?? "";

// To build with the paragraph API's, you need to set this to true, and
// you need to update the following files with some uncommenting:
// 1) CMakeLists.txt
// 2) react-native-skia.podspec
// 3) package.json - add the following files to the files array:
// - "libs/ios/libskparagraph.xcframework",
// - "libs/ios/libskunicode.xcframework",
export const BUILD_WITH_PARAGRAPH = false;
const ParagraphArgs = BUILD_WITH_PARAGRAPH
? [
["skia_enable_paragraph", true],
["skia_use_icu", true],
["skia_use_system_icu", false],
["skia_use_harfbuzz", true],
["skia_use_system_harfbuzz", false],
]
: [
["skia_use_harfbuzz", false],
["skia_use_icu", false],
];

const ParagraphOutputs = BUILD_WITH_PARAGRAPH
? ["libskparagraph.a", "libskunicode.a"]
: [];

export const commonArgs = [
["skia_use_piex", true],
["skia_use_sfntly", false],
Expand All @@ -18,11 +43,7 @@ export const commonArgs = [
["skia_enable_flutter_defines", true],
["paragraph_tests_enabled", false],
["is_component_build", false],
["skia_enable_paragraph", true],
["skia_use_icu", true],
["skia_use_system_icu", false],
["skia_use_harfbuzz", true],
["skia_use_system_harfbuzz", false],
...ParagraphArgs,
];

export type PlatformName = "ios" | "android";
Expand Down Expand Up @@ -82,8 +103,7 @@ export const configurations: Configuration = {
"libsvg.a",
"libskottie.a",
"libsksg.a",
"libskparagraph.a",
"libskunicode.a",
...ParagraphOutputs,
],
},
ios: {
Expand Down Expand Up @@ -135,8 +155,7 @@ export const configurations: Configuration = {
"libsvg.a",
"libskottie.a",
"libsksg.a",
"libskparagraph.a",
"libskunicode.a",
...ParagraphOutputs,
],
},
};

0 comments on commit 26f5ecb

Please sign in to comment.