@@ -40,68 +40,59 @@ echo "Detected OS: $OS"
4040echo " "
4141
4242#
43- # 1. BoringSSL
43+ # 1. BoringSSL / OpenSSL
4444#
45- echo " ==> Setting up BoringSSL ..."
45+ echo " ==> Setting up SSL library ..."
4646
47- if [ ! -d " boringssl" ]; then
48- echo " Cloning BoringSSL..."
49- git clone --depth 1 https://boringssl.googlesource.com/boringssl
50- fi
51-
52- cd boringssl
47+ # On Windows, use vcpkg's OpenSSL instead of building BoringSSL
48+ if [ " $OS " = " Windows" ] && [ -n " $VCPKG_ROOT " ] && [ -d " $VCPKG_ROOT /installed/x64-windows" ]; then
49+ echo " ✓ Using vcpkg's OpenSSL (Windows)"
50+ echo " Location: $VCPKG_ROOT /installed/x64-windows"
51+ else
52+ # On Linux/macOS, build BoringSSL
53+ if [ ! -d " boringssl" ]; then
54+ echo " Cloning BoringSSL..."
55+ git clone --depth 1 https://boringssl.googlesource.com/boringssl
56+ fi
5357
54- # Check if already built
55- BUILD_MARKER=" build/ssl/libssl.a"
56- if [ " $OS " = " Windows" ]; then
57- BUILD_MARKER=" build/ssl/Release/ssl.lib"
58- fi
58+ cd boringssl
5959
60- if [ ! -f " $BUILD_MARKER " ]; then
61- echo " Building BoringSSL..."
60+ # Check if already built
61+ if [ ! -f " build/ssl/libssl.a" ]; then
62+ echo " Building BoringSSL..."
6263
63- # BoringSSL requires CMake and Go
64- if ! command -v cmake & > /dev/null; then
65- echo " ERROR: cmake not found. Please install cmake."
66- exit 1
67- fi
64+ # BoringSSL requires CMake and Go
65+ if ! command -v cmake & > /dev/null; then
66+ echo " ERROR: cmake not found. Please install cmake."
67+ exit 1
68+ fi
6869
69- if ! command -v go & > /dev/null; then
70- echo " WARNING: go not found. BoringSSL will build without some tests."
71- fi
70+ if ! command -v go & > /dev/null; then
71+ echo " WARNING: go not found. BoringSSL will build without some tests."
72+ fi
7273
73- mkdir -p build
74- cd build
74+ mkdir -p build
75+ cd build
7576
76- # Configure based on OS
77- if [ " $OS " = " Windows" ]; then
78- # Windows with MSVC - use Ninja generator for faster builds
79- cmake -G " Ninja" \
80- -DCMAKE_BUILD_TYPE=Release \
81- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
82- ..
83- ninja
84- else
85- # Linux/macOS - use Unix Makefiles
8677 cmake -DCMAKE_BUILD_TYPE=Release \
8778 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
8879 ..
8980 make -j$( nproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 4)
90- fi
9181
92- echo " ✓ BoringSSL built successfully"
82+ echo " ✓ BoringSSL built successfully"
9383
94- # Clean up .git directory to save cache space
95- cd " $VENDOR_DIR /boringssl"
96- if [ -d " .git" ]; then
97- echo " Cleaning up .git directory to save cache space..."
98- rm -rf .git
84+ # Clean up .git directory to save cache space
85+ cd " $VENDOR_DIR /boringssl"
86+ if [ -d " .git" ]; then
87+ echo " Cleaning up .git directory to save cache space..."
88+ rm -rf .git
89+ fi
90+ else
91+ echo " ✓ BoringSSL already built"
9992 fi
100- else
101- echo " ✓ BoringSSL already built"
102- fi
10393
104- cd " $VENDOR_DIR "
94+ cd " $VENDOR_DIR "
95+ fi
10596
10697#
10798# 2. liburing (Linux only)
@@ -212,7 +203,11 @@ echo "Vendor Setup Complete!"
212203echo " ================================"
213204echo " "
214205echo " Built libraries:"
215- echo " ✓ BoringSSL: $VENDOR_DIR /boringssl/build"
206+ if [ " $OS " = " Windows" ] && [ -n " $VCPKG_ROOT " ] && [ -d " $VCPKG_ROOT /installed/x64-windows" ]; then
207+ echo " ✓ OpenSSL: $VCPKG_ROOT /installed/x64-windows (vcpkg)"
208+ else
209+ echo " ✓ BoringSSL: $VENDOR_DIR /boringssl/build"
210+ fi
216211if [ " $OS " = " Linux" ]; then
217212 echo " ✓ liburing: $VENDOR_DIR /liburing/install"
218213fi
0 commit comments