Skip to content

Commit

Permalink
chore(v8): only build v8bridge with clang when libwee8 uses clang
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Jan 30, 2024
1 parent 574ecb6 commit fda6087
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions util/runtimes/v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,20 @@ build_v8bridge() {
make -C "$NGX_WASM_DIR/lib/v8bridge" clean
fi

# Use the same V8 clang toolchain to build v8bridge - C++ ABI compatibility
local v8_cxx="$DIR_LIBWEE8/repos/v8/third_party/llvm-build/Release+Asserts/bin/clang"
local v8_cxx="$CC"

if [[ "$(uname -s)" = "Darwin" ]]; then
# On macOS builds, use the system-provided clang to avoid header issues
v8_cxx="clang"
if [ "$v8_cxx" = "clang" ]; then
# Use the same V8 clang toolchain to build v8bridge - C++ ABI compatibility
v8_cxx="$DIR_LIBWEE8/repos/v8/third_party/llvm-build/Release+Asserts/bin/clang"

elif [[ "$(uname -m)" = "aarch64" ]]; then
# V8 clang is built for x86_64; if running on arm64 defaults to gcc
v8_cxx="gcc"
if [[ "$(uname -s)" = "Darwin" ]]; then
# On macOS builds, use the system-provided clang to avoid header issues
v8_cxx="clang"

elif [[ "$(uname -m)" = "aarch64" ]]; then
# V8 clang is built for x86_64; if running on arm64 defaults to gcc
v8_cxx="gcc"
fi
fi

make -C "$NGX_WASM_DIR/lib/v8bridge" \
Expand Down

0 comments on commit fda6087

Please sign in to comment.