mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-27 16:00:49 +08:00
build: 启用显式 RKMPP 构建
This commit is contained in:
@@ -18,6 +18,10 @@ ARCH_MAP=(
|
||||
# Build for specific architecture using cross
|
||||
build_arch() {
|
||||
local rust_target="$1"
|
||||
local feature_args=()
|
||||
case "$rust_target" in
|
||||
aarch64-*|armv7-*) feature_args=(--features rkmpp) ;;
|
||||
esac
|
||||
|
||||
case "${CHINAMIRRO:-}" in
|
||||
1|true|TRUE|yes|YES|on|ON)
|
||||
@@ -40,13 +44,13 @@ build_arch() {
|
||||
CARGO_NET_GIT_FETCH_WITH_CLI=true \
|
||||
RUSTUP_DIST_SERVER="$rust_dist" \
|
||||
RUSTUP_UPDATE_ROOT="$rust_root" \
|
||||
cross build --release --target "$rust_target"
|
||||
cross build --release --target "$rust_target" "${feature_args[@]}"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "=== Building: $rust_target (via cross with custom Dockerfile) ==="
|
||||
cross build --release --target "$rust_target"
|
||||
cross build --release --target "$rust_target" "${feature_args[@]}"
|
||||
}
|
||||
|
||||
# Main
|
||||
|
||||
@@ -268,14 +268,18 @@ build_for_platform() {
|
||||
if [ "$BUILD_BINARY" = true ]; then
|
||||
echo_info "Building binary with cross..."
|
||||
cd "$PROJECT_ROOT"
|
||||
cross build --release --target "$target"
|
||||
local feature_args=()
|
||||
case "$target" in
|
||||
aarch64-*|armv7-*) feature_args=(--features rkmpp) ;;
|
||||
esac
|
||||
cross build --release --target "$target" "${feature_args[@]}"
|
||||
fi
|
||||
|
||||
# Check binary exists
|
||||
local binary="$PROJECT_ROOT/target/$target/release/one-kvm"
|
||||
if [ ! -f "$binary" ]; then
|
||||
echo_error "Binary not found: $binary"
|
||||
echo_error "Build it first: cross build --release --target $target"
|
||||
echo_error "Build it first: ./build/build-images.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user