diff --git a/scripts/build_sdk.sh b/scripts/build_sdk.sh index 1fb55e9..d98ecc5 100755 --- a/scripts/build_sdk.sh +++ b/scripts/build_sdk.sh @@ -26,7 +26,10 @@ repo=$(cd "$here/.." && pwd) eval "$("$here/detect_platform.sh")" SDK_REPO="${OB_SDK_REPO:-https://github.com/orbbec/OrbbecSDK_v2.git}" -SDK_REF="${OB_SDK_REF:-main}" +# Pinned to the version the recorder source is written against: v2.4.3 (which came +# pre-placed on the Orin) lacks ob::Error::getStatus() that the recorder uses. A +# caller can override for a platform that needs a different tag. +SDK_REF="${OB_SDK_REF:-v2.8.6}" find_build() { local root="$1" b @@ -100,11 +103,14 @@ inject_recorder "$root" cmake_k4a=() [[ -n "${K4A_WRAPPER_DIR:-}" ]] && cmake_k4a=(-DK4A_WRAPPER_DIR="$K4A_WRAPPER_DIR") -build="$root/build/linux_$(uname -m)" -mkdir -p "$build" +# Build in $root/build and configure from there (cmake ..): the SDK's own +# linux_config.cmake places its outputs in a build/linux_ subdir itself. +# Creating that subdir and configuring from inside it double-nests the outputs +# (build/linux_aarch64/linux_arm64/lib), where find_build cannot see them. +mkdir -p "$root/build" ( - cd "$build" - cmake ../.. -DCMAKE_BUILD_TYPE=Release -DOB_BUILD_EXAMPLES=ON "${cmake_k4a[@]}" >&2 + cd "$root/build" + cmake .. -DCMAKE_BUILD_TYPE=Release -DOB_BUILD_EXAMPLES=ON "${cmake_k4a[@]}" >&2 make -j"$(nproc)" >&2 )