50 lines
1.7 KiB
Bash
Executable File
50 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ---------------------------------------------------------
|
|
# Autoware 编译脚本
|
|
# ---------------------------------------------------------
|
|
set -euo pipefail
|
|
|
|
readonly RED='\033[0;31m'
|
|
readonly GREEN='\033[0;32m'
|
|
readonly NC='\033[0m'
|
|
|
|
log() { echo -e "${GREEN}[INFO]${NC} $*"; }
|
|
warn() { echo -e "${RED}[WARN]${NC} $*" >&2; }
|
|
|
|
BUILD_ARGS=(
|
|
colcon build
|
|
--symlink-install
|
|
--cmake-args -DCMAKE_BUILD_TYPE=Release
|
|
)
|
|
|
|
# 如需部分包编译,把 xxx 换成包名后取消下一行注释
|
|
BUILD_ARGS+=(--packages-select calibration_chassis_interfaces \
|
|
calibration_control_interfaces \
|
|
calibration_common_interfaces \
|
|
calibration_external_localization_interfaces \
|
|
calibration_sensor_interfaces \
|
|
calibration_vehicle_profile_interfaces \
|
|
calibration_workshop_orchestration_interfaces \
|
|
workshop_orchestrator_v2 \
|
|
vehicle_profile_manager \
|
|
external_localization_service \
|
|
chassis_calibration_service \
|
|
control_calibration_service \
|
|
sensor_calibration_service \
|
|
vehicle_agent_gateway \
|
|
win_ubuntu_bridge
|
|
)
|
|
|
|
log "Starting colcon build..."
|
|
if AUTOWARE_COMPILE_WITH_CUDA=1 "${BUILD_ARGS[@]}"; then
|
|
log "Build succeeded. Sourcing workspace..."
|
|
|
|
# 临时关闭 -u,避免 COLCON_TRACE 未定义报错
|
|
set +u
|
|
source install/setup.bash
|
|
set -u
|
|
|
|
log "Done."
|
|
else
|
|
warn "Build failed, skip sourcing."
|
|
fi |