Hmm, can't build crosstool-ng yet.
This commit is contained in:
34
test/crossbuild.sh
Executable file
34
test/crossbuild.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
TARGET_ARCH="aarch64"
|
||||
OUTDIR="output-${TARGET_ARCH}"
|
||||
|
||||
# Create volume if it doesn't exist
|
||||
docker volume create cppbuild-cache-${TARGET_ARCH}
|
||||
|
||||
# Build command to run in the container
|
||||
BUILD_COMMAND="mkdir -p /app/build && \
|
||||
cd /app/build && \
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/app/src/cmake/${TARGET_ARCH}-linux-gnu.cmake \
|
||||
/app/src && \
|
||||
ninja -j$(nproc) && \
|
||||
mkdir -p /app/src/$OUTDIR && \
|
||||
cp /app/build/ipdemo /app/src/$OUTDIR/ipdemo && \
|
||||
chown -R $(id -u):$(id -g) /app/src/$OUTDIR"
|
||||
|
||||
# Run the build in the container
|
||||
docker run --rm \
|
||||
-v cppbuild-cache-${TARGET_ARCH}:/app/build \
|
||||
-v $(pwd):/app/src \
|
||||
-w /app/src \
|
||||
-e CCACHE_DIR=/app/build/.ccache \
|
||||
-e CC="ccache /opt/cross/bin/aarch64-unknown-linux-musl-gcc" \
|
||||
-e CXX="ccache /opt/cross/bin/aarch64-unknown-linux-musl-g++" \
|
||||
-e LD=mold \
|
||||
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
||||
-e NINJA_STATUS="[%f/%t] " \
|
||||
cpp-httplib-builder:latest \
|
||||
-c "$BUILD_COMMAND"
|
||||
|
||||
echo "Build completed. Output is in $OUTDIR directory"
|
Reference in New Issue
Block a user