Skip to content

Commit 75f5a0b

Browse files
committed
Problem: cargo binary dynamically links against host's homebrew openssl
Solution: Tell it to link statically so it's usable even on a machine that doesn't have homebrew openssl installed.
1 parent 179cd53 commit 75f5a0b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

build.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
set -euxo
33
source config.sh
44

5-
WORKING_DIR="$(pwd)/build"
6-
mkdir -p "$WORKING_DIR"
7-
5+
export OPENSSL_STATIC=1
6+
export OPENSSL_DIR=/usr/local/opt/openssl
7+
if [ ! -d "$OPENSSL_DIR" ]; then
8+
echo "OpenSSL not found at expected location. Try: brew install openssl"
9+
exit 1
10+
fi
811
if ! which ninja; then
912
echo "ninja not found. Try: brew install ninja"
1013
exit 1
@@ -14,6 +17,9 @@ if ! which cmake; then
1417
exit 1
1518
fi
1619

20+
WORKING_DIR="$(pwd)/build"
21+
mkdir -p "$WORKING_DIR"
22+
1723
cd "$WORKING_DIR"
1824
if [ ! -d "$WORKING_DIR/llvm-project" ]; then
1925
git clone https://github.com/apple/llvm-project.git

0 commit comments

Comments
 (0)