Skip to content

Commit 09715e6

Browse files
committed
osx ci: Install Boost to /opt/boost instead of /usr/local
1 parent 1cd7045 commit 09715e6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Diff for: .circleci/config.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ commands:
385385
name: Installing dependencies / Restoring dependency cache
386386
command: |
387387
if [[ -f ~/osx-dependencies-cached ]]; then
388-
echo "Dependency flag exists. Removing /usr/local/ and /opt/homebrew/. These directories will be restored from cache."
388+
echo "Dependency flag exists. Removing /usr/local/, /opt/homebrew/, and /opt/boost. These directories will be restored from cache."
389389
390390
# CircleCI is providing the circleci cli tools via some kind of symlink magic.
391391
# So we just save the original symlinks and restore them later.
@@ -405,6 +405,10 @@ commands:
405405
sudo mkdir -p /usr/local/bin
406406
sudo chmod 777 /usr/{local,local/bin}
407407
408+
sudo rm -rf /opt/boost
409+
sudo mkdir -p /opt/boost
410+
sudo chmod 777 /opt/boost
411+
408412
mv /tmp/circleci "${circleci_binary_path}"
409413
mv /tmp/circleci-agent "${circleci_agent_binary_path}"
410414
fi
@@ -425,6 +429,7 @@ commands:
425429
# Homebrew is installed in /usr/local on intel macs, but in /opt/homebrew on apple silicon.
426430
- /usr/local
427431
- /opt/homebrew
432+
- /opt/boost
428433
- save_cache:
429434
key: osx-dependencies-cached-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
430435
paths:
@@ -1159,7 +1164,8 @@ jobs:
11591164
environment:
11601165
<<: *base_osx_env
11611166
CMAKE_BUILD_TYPE: Release
1162-
CMAKE_OPTIONS: -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64
1167+
# boost root configured to the prefix used in `osx_install_dependencies.sh`
1168+
CMAKE_OPTIONS: -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64 -DBoost_ROOT=/opt/boost
11631169
steps:
11641170
- checkout
11651171
- install_dependencies_osx

Diff for: .circleci/osx_install_dependencies.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ then
6969
cd "$boost_dir"
7070
./bootstrap.sh --with-toolset=clang --with-libraries=thread,system,filesystem,program_options,serialization,test
7171
# the default number of jobs that b2 is taking, is the number of detected available CPU threads.
72-
sudo ./b2 -a address-model=64 architecture=arm+x86 install
72+
# install boost to /opt/boost, to use it in CMake, specify Boost_ROOT
73+
sudo ./b2 -a address-model=64 architecture=arm+x86 --prefix=/opt/boost install
7374
cd ..
7475
sudo rm -rf "$boost_dir"
7576

0 commit comments

Comments
 (0)