ci: support building with custom boost version on macos

This commit is contained in:
Jörg Hofrichter 2025-10-07 09:40:20 +02:00
parent c6f793cc22
commit c174147142
3 changed files with 48 additions and 0 deletions

View File

@ -9,6 +9,12 @@ parameters:
- msbuild
- msbuild_python
- make_homebrew_macos
# note: the parameter 'custom_boost_version' is currently only evaluated in case of 'toolset'='make_homebrew_macos'
- name: 'custom_boost_version'
type: boolean
default: false
# note: the parameter 'custom_boost_version_url' is currently only evaluated in case of 'toolset'='make_homebrew_macos'
# and 'toolset'='make_custom_boost_version'
- name: 'custom_boost_version_url'
type: string
default: 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'
@ -95,6 +101,8 @@ jobs:
uhdSrcDir: $(Build.SourcesDirectory)
uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build
uhdGenerateTestBinaries: true
uhdCustomBoostPackage: ${{ parameters.custom_boost_version }}
uhdCustomBoostPackageURL: ${{ parameters.custom_boost_version_url }}
- ${{ if eq(parameters.toolset, 'ninja') }}:
- template: steps-build-uhd-ninja.yml

View File

@ -313,6 +313,8 @@ stages:
- template: job-uhd-build-src.yml
parameters:
toolset: make_homebrew_macos
custom_boost_version: ${{ parameters.custom_boost_version }}
custom_boost_version_url: ${{ parameters.custom_boost_version_url }}
- stage: build_uhd_embedded_system_images
displayName: Build UHD Embedded System Images

View File

@ -6,8 +6,41 @@ parameters:
- name: uhdGenerateTestBinaries
type: boolean
default: false
- name: uhdCustomBoostPackage
type: boolean
default: false
- name: uhdCustomBoostPackageURL
type: string
default: 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'
steps:
- ${{ if parameters.uhdCustomBoostPackage }}:
- bash: |
cd $(Pipeline.Workspace)
echo "Entering workspace directory:"
pwd
rm -rf boost
mkdir boost
cd boost
# We reimplement tar's -a flag here so we can pipe from curl straight to tar
if [[ "${{ parameters.uhdCustomBoostPackageURL }}" =~ bz2$ ]]; then
export TAR_EXTRACT_FLAG="j"
elif [[ "${{ parameters.uhdCustomBoostPackageURL }}" =~ gz$ ]]; then
export TAR_EXTRACT_FLAG="z"
elif [[ "${{ parameters.uhdCustomBoostPackageURL }}" =~ xz$ ]]; then
export TAR_EXTRACT_FLAG="J"
fi
curl -L ${{ parameters.uhdCustomBoostPackageURL }} | tar -x -$TAR_EXTRACT_FLAG
export BOOST_DIR=`pwd`/`ls | head -1`
echo "Using Boost directory: $BOOST_DIR"
echo "##vso[task.setvariable variable=CustomBoostPath;isOutput=true;]$BOOST_DIR"
cd $BOOST_DIR
BOOST_INSTALL_DIR=${{ parameters.uhdBuildDir }}-boost
./bootstrap.sh --prefix=${BOOST_INSTALL_DIR} --includedir=headers --libdir=dist --with-libraries=chrono,date_time,filesystem,program_options,serialization,test,thread
./b2 -j$(nproc) --prefix=${BOOST_INSTALL_DIR} install
displayName: "Build Custom Boost Version"
name: build_boost_step
- script: |
mkdir -p ${{ parameters.uhdBuildDir }}
cd ${{ parameters.uhdBuildDir }}
@ -26,9 +59,14 @@ steps:
export UHD_CI_CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${{ parameters.uhdBuildDir }}-installed"
export UHD_CI_CMAKE_SIM="-DENABLE_SIM=OFF"
fi
if [[ "${{ parameters.uhdCustomBoostPackage }}" = "True" ]]; then
BOOST_INSTALL_DIR=${{ parameters.uhdBuildDir }}-boost
export UHD_BOOST_OPTIONS="-DCMAKE_PREFIX_PATH=$BOOST_INSTALL_DIR"
fi
cmake \
$UHD_CI_CMAKE_OPTIONS \
$UHD_CI_CMAKE_SIM \
$UHD_BOOST_OPTIONS \
${{ parameters.uhdSrcDir }}/host
displayName: cmake homebrew macOS UHD