aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-26 22:57:49 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-26 22:57:49 -0700
commit5ce1b36130c311c502aaec0280005ffe01bc146f (patch)
treec2309d1616f7709880039d07a50ee68d7d0cc642
parenta1f17f70ebf494fd39975daad805d4e5fb59f7f9 (diff)
downloadbun-5ce1b36130c311c502aaec0280005ffe01bc146f.tar.gz
bun-5ce1b36130c311c502aaec0280005ffe01bc146f.tar.zst
bun-5ce1b36130c311c502aaec0280005ffe01bc146f.zip
Choose different clang for macOS and Linux
-rw-r--r--Makefile14
1 files changed, 3 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index f54a45260..d514331ab 100644
--- a/Makefile
+++ b/Makefile
@@ -28,8 +28,9 @@ BUN_BUILD_TAG = bun-v$(PACKAGE_JSON_VERSION)
# We must use the same compiler version for the JavaScriptCore bindings and JavaScriptCore
# If we don't do this, strange memory allocation failures occur.
# This is easier to happen than you'd expect.
-CC = clang-12
-CXX = clang++-12
+
+CC = $(shell which clang-12 || which clang)
+CXX = $(shell which clang++-12 || which clang++)
DEPS_DIR = $(shell pwd)/src/deps
CPUS ?= $(shell nproc)
@@ -623,15 +624,6 @@ bun-link-lld-release:
$(STRIP) $(BIN_DIR)/bun
mv $(BIN_DIR)/bun.o /tmp/bun-$(PACKAGE_JSON_VERSION).o
-bun-link-lld-release-aarch64:
- $(CXX) $(BUN_LLD_FLAGS) \
- build/macos-aarch64/bun.o \
- -o build/macos-aarch64/bun \
- -Wl,-dead_strip \
- -ftls-model=initial-exec \
- -flto \
- -O3
-
# We do this outside of build.zig for performance reasons
# The C compilation stuff with build.zig is really slow and we don't need to run this as often as the rest
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp