Skip to content

Commit

Permalink
Don't link libicudata? (#9424)
Browse files Browse the repository at this point in the history
* Don't link libicudata?

* Fixups

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
  • Loading branch information
Jarred-Sumner and Jarred-Sumner authored Mar 15, 2024
1 parent 1e090a7 commit e256751
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
16 changes: 1 addition & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ if(NOT WEBKIT_DIR)
set(WEBKIT_INCLUDE_DIR "${BUN_WORKDIR}/bun-webkit/include")

if(APPLE)
set(ICU_INCLUDE_DIR "${HOMEBREW_PREFIX}/opt/icu4c/include")
set(ICU_INCLUDE_DIR "")
else()
set(ICU_INCLUDE_DIR "${BUN_WORKDIR}/bun-webkit/include/wtf/unicode")
endif()
Expand Down Expand Up @@ -1146,21 +1146,7 @@ endif()

# --- ICU ---
if(APPLE)
# TODO: a much better check can be done to find this path
find_path(
ICU4C_DIR NAMES lib/libicudata.a
PATHS ENV PATH /usr/local/opt/icu4c /opt/homebrew/opt/icu4c
)
find_path(
ICONV_DIR NAMES lib/libiconv.a
PATHS ENV PATH /usr/local/opt/libiconv /opt/homebrew/opt/libiconv
)

target_link_libraries(${bun} PRIVATE "icucore")
target_link_libraries(${bun} PRIVATE "${ICONV_DIR}/lib/libiconv.a")
target_link_libraries(${bun} PRIVATE "${ICU4C_DIR}/lib/libicudata.a")
target_link_libraries(${bun} PRIVATE "${ICU4C_DIR}/lib/libicui18n.a")
target_link_libraries(${bun} PRIVATE "${ICU4C_DIR}/lib/libicuuc.a")
endif()

# --- Stripped Binary "bun"
Expand Down
9 changes: 7 additions & 2 deletions scripts/download-webkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ if [ -z "$PKG" ]; then
exit 1
fi


url="https://github.com/oven-sh/WebKit/releases/download/autobuild-$TAG/$PKG.tar.gz"

old_tar_dir="$(dirname "$0")/../.webkit-cache"
Expand Down Expand Up @@ -54,4 +53,10 @@ fi

tar -xzf "$tar" -C "$(dirname "$OUTDIR")" || (rm "$tar" && exit 1)

echo "$TAG-$PKG" > "$OUTDIR/.tag"
# We want to make sure we use the system-version of icucore on macOS
if [ "$(uname)" == "Darwin" ]; then
# delete the unicode folder from include
rm -rf "$OUTDIR/include/unicode"
fi

echo "$TAG-$PKG" >"$OUTDIR/.tag"

0 comments on commit e256751

Please sign in to comment.