Skip to content

Commit c174147

Browse files
committed
ci: support building with custom boost version on macos
1 parent c6f793c commit c174147

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.ci/templates/job-uhd-build-src.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ parameters:
99
- msbuild
1010
- msbuild_python
1111
- make_homebrew_macos
12+
# note: the parameter 'custom_boost_version' is currently only evaluated in case of 'toolset'='make_homebrew_macos'
13+
- name: 'custom_boost_version'
14+
type: boolean
15+
default: false
16+
# note: the parameter 'custom_boost_version_url' is currently only evaluated in case of 'toolset'='make_homebrew_macos'
17+
# and 'toolset'='make_custom_boost_version'
1218
- name: 'custom_boost_version_url'
1319
type: string
1420
default: 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'
@@ -95,6 +101,8 @@ jobs:
95101
uhdSrcDir: $(Build.SourcesDirectory)
96102
uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build
97103
uhdGenerateTestBinaries: true
104+
uhdCustomBoostPackage: ${{ parameters.custom_boost_version }}
105+
uhdCustomBoostPackageURL: ${{ parameters.custom_boost_version_url }}
98106

99107
- ${{ if eq(parameters.toolset, 'ninja') }}:
100108
- template: steps-build-uhd-ninja.yml

.ci/templates/stages-uhd-pipeline.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ stages:
313313
- template: job-uhd-build-src.yml
314314
parameters:
315315
toolset: make_homebrew_macos
316+
custom_boost_version: ${{ parameters.custom_boost_version }}
317+
custom_boost_version_url: ${{ parameters.custom_boost_version_url }}
316318

317319
- stage: build_uhd_embedded_system_images
318320
displayName: Build UHD Embedded System Images

.ci/templates/steps-build-uhd-make-homebrew-macos.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,41 @@ parameters:
66
- name: uhdGenerateTestBinaries
77
type: boolean
88
default: false
9+
- name: uhdCustomBoostPackage
10+
type: boolean
11+
default: false
12+
- name: uhdCustomBoostPackageURL
13+
type: string
14+
default: 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'
915

1016
steps:
17+
- ${{ if parameters.uhdCustomBoostPackage }}:
18+
- bash: |
19+
cd $(Pipeline.Workspace)
20+
echo "Entering workspace directory:"
21+
pwd
22+
rm -rf boost
23+
mkdir boost
24+
cd boost
25+
# We reimplement tar's -a flag here so we can pipe from curl straight to tar
26+
if [[ "${{ parameters.uhdCustomBoostPackageURL }}" =~ bz2$ ]]; then
27+
export TAR_EXTRACT_FLAG="j"
28+
elif [[ "${{ parameters.uhdCustomBoostPackageURL }}" =~ gz$ ]]; then
29+
export TAR_EXTRACT_FLAG="z"
30+
elif [[ "${{ parameters.uhdCustomBoostPackageURL }}" =~ xz$ ]]; then
31+
export TAR_EXTRACT_FLAG="J"
32+
fi
33+
curl -L ${{ parameters.uhdCustomBoostPackageURL }} | tar -x -$TAR_EXTRACT_FLAG
34+
export BOOST_DIR=`pwd`/`ls | head -1`
35+
echo "Using Boost directory: $BOOST_DIR"
36+
echo "##vso[task.setvariable variable=CustomBoostPath;isOutput=true;]$BOOST_DIR"
37+
cd $BOOST_DIR
38+
BOOST_INSTALL_DIR=${{ parameters.uhdBuildDir }}-boost
39+
./bootstrap.sh --prefix=${BOOST_INSTALL_DIR} --includedir=headers --libdir=dist --with-libraries=chrono,date_time,filesystem,program_options,serialization,test,thread
40+
./b2 -j$(nproc) --prefix=${BOOST_INSTALL_DIR} install
41+
displayName: "Build Custom Boost Version"
42+
name: build_boost_step
43+
1144
- script: |
1245
mkdir -p ${{ parameters.uhdBuildDir }}
1346
cd ${{ parameters.uhdBuildDir }}
@@ -26,9 +59,14 @@ steps:
2659
export UHD_CI_CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${{ parameters.uhdBuildDir }}-installed"
2760
export UHD_CI_CMAKE_SIM="-DENABLE_SIM=OFF"
2861
fi
62+
if [[ "${{ parameters.uhdCustomBoostPackage }}" = "True" ]]; then
63+
BOOST_INSTALL_DIR=${{ parameters.uhdBuildDir }}-boost
64+
export UHD_BOOST_OPTIONS="-DCMAKE_PREFIX_PATH=$BOOST_INSTALL_DIR"
65+
fi
2966
cmake \
3067
$UHD_CI_CMAKE_OPTIONS \
3168
$UHD_CI_CMAKE_SIM \
69+
$UHD_BOOST_OPTIONS \
3270
${{ parameters.uhdSrcDir }}/host
3371
displayName: cmake homebrew macOS UHD
3472

0 commit comments

Comments
 (0)