Skip to content

Commit

Permalink
add back macOS script for building boost libraries
Browse files Browse the repository at this point in the history
boost_libs=<library> install-boost.sh --build

partically revert "drop boost regex lib for windows and macos (rime#735)"

This reverts install-boost.sh from commit 298a9dd.
  • Loading branch information
lotem authored and graphemecluster committed Feb 9, 2024
1 parent 74d7421 commit 1b2b9e1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions install-boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ download_boost_source() {
[[ -f "${BOOST_ROOT}/bootstrap.sh" ]]
}

boost_cxxflags='-arch arm64 -arch x86_64'

build_boost_macos() {
[[ -n "${boost_libs}" ]] || return
cd "${BOOST_ROOT}"
./bootstrap.sh --with-toolset=clang --with-libraries="${boost_libs}"
./b2 -q -a link=static architecture=arm cxxflags="${boost_cxxflags}" stage
for lib in stage/lib/*.a; do
lipo $lib -info
done
}

if [[ $# -eq 0 || " $* " =~ ' --download ' ]]; then
if [[ ! -f "${BOOST_ROOT}/bootstrap.sh" ]]; then
download_boost_source
Expand All @@ -31,3 +43,8 @@ if [[ $# -eq 0 || " $* " =~ ' --download ' ]]; then
./bootstrap.sh
./b2 headers
fi
if [[ $# -eq 0 || " $* " =~ ' --build ' ]]; then
if [[ "$OSTYPE" =~ 'darwin' ]]; then
build_boost_macos
fi
fi

0 comments on commit 1b2b9e1

Please sign in to comment.