@@ -28,6 +28,15 @@ cd "$VENDOR_DIR"
2828#
2929echo " ==> Setting up BoringSSL..."
3030
31+ # Always ensure clean BoringSSL clone to avoid platform detection issues
32+ if [ -d " boringssl" ]; then
33+ # Check if build exists, if not, remove and re-clone
34+ if [ ! -f " boringssl/build/libssl.a" ]; then
35+ echo " Removing incomplete BoringSSL clone..."
36+ rm -rf boringssl
37+ fi
38+ fi
39+
3140if [ ! -d " boringssl" ]; then
3241 echo " Cloning BoringSSL..."
3342 git clone --depth 1 https://boringssl.googlesource.com/boringssl
@@ -49,17 +58,27 @@ if [ ! -f "build/libssl.a" ]; then
4958 echo " WARNING: go not found. BoringSSL will build without some tests."
5059 fi
5160
61+ # Clean build directory if it exists (in case of previous failed build)
62+ if [ -d " build" ]; then
63+ echo " Cleaning previous build..."
64+ rm -rf build
65+ fi
66+
5267 mkdir -p build
5368 cd build
5469
5570 # Linux typically uses GCC - disable false positive warning
5671 CMAKE_C_FLAGS=" -Wno-maybe-uninitialized"
5772 CMAKE_CXX_FLAGS=" -Wno-maybe-uninitialized"
5873
59- # Explicitly set system name to Linux to prevent cross-platform confusion
74+ # Force CMake to regenerate all platform detection
75+ # Unset any environment variables that might confuse platform detection
76+ unset CMAKE_OSX_ARCHITECTURES
77+ unset CMAKE_OSX_DEPLOYMENT_TARGET
78+ unset CMAKE_OSX_SYSROOT
79+
6080 cmake -DCMAKE_BUILD_TYPE=Release \
6181 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
62- -DCMAKE_SYSTEM_NAME=Linux \
6382 -DCMAKE_C_FLAGS=" $CMAKE_C_FLAGS " \
6483 -DCMAKE_CXX_FLAGS=" $CMAKE_CXX_FLAGS " \
6584 ..
0 commit comments