-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·46 lines (35 loc) · 1.43 KB
/
build.sh
File metadata and controls
executable file
·46 lines (35 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Build script for Conch Cross-Platform Project
set -e
echo "🚀 Starting Conch Cross-Platform Build..."
# Create build directory if it doesn't exist
if [ ! -d "build" ]; then
echo "📁 Creating build directory..."
mkdir -p build
fi
cd build
# Auto-detect system settings (OS, compiler) and generate a default profile.
# The --force flag ensures it overwrites any existing profile to avoid errors.
conan profile detect --force
CONAN_ARGS=""
# [MacOS] Suppress 'unguarded-availability' errors triggered by recent SDK updates.
if [[ "$(uname)" == "Darwin" ]]; then
echo "macOS detected - Applying Xcode 16.4+ compatibility fix..."
CONAN_ARGS="$CONAN_ARGS -c tools.build:cflags+=[\"-Wno-error=unguarded-availability-new\"]"
CONAN_ARGS="$CONAN_ARGS -c tools.build:cxxflags+=[\"-Wno-error=unguarded-availability-new\"]"
fi
# Install dependencies with Conan
echo "📦 Installing dependencies with Conan..."
conan install .. \
--build=missing \
-c tools.system.package_manager:mode=install \
-c tools.system.package_manager:sudo=True \
$CONAN_ARGS
# Configure CMake with Conan toolchain
echo "🔧 Configuring CMake..."
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake
# Build
echo "🔨 Building project..."
cmake --build . --config Release -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
echo "✅ Build complete! Binaries are in build/bin/"