Skip to content

Commit

Permalink
version 1.82
Browse files Browse the repository at this point in the history
  • Loading branch information
apotocki committed Apr 16, 2023
1 parent 3e19435 commit a400ddc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- name: Build
run: |
export ICU4C_RELEASE_LINK=https://github.com/apotocki/icu4c-iosx/releases/download/72.1.1
export ICU4C_RELEASE_LINK=https://github.com/apotocki/icu4c-iosx/releases/download/73.1.0
scripts/build.sh
for i in frameworks/*.xcframework/; do cd frameworks && zip -9 -r "$(basename -- $i).zip" $(basename -- $i) & done; wait
cd frameworks
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Boost C++ for iOS and Mac OS X (Intel & Apple Silicon M1) & Catalyst - arm64 / x86_64

Supported version: 1.81.0 (use the appropriate tag to select the version)
Supported version: 1.82.0 (use the appropriate tag to select the version)

This repo provides a universal script for building static Boost C++ libraries for use in iOS and Mac OS X & Catalyst applications.
The latest supported Boost version is taken from: https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
The latest supported Boost version is taken from: https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2

## Building libraries
atomic, chrono, container, context, contract, coroutine, date_time, exception, fiber, filesystem, graph, iostreams, json, locale, log, math, nowide, program_options, random, regex, serialization, stacktrace, system, test, thread, timer, type_erasure, url, wave
Expand All @@ -25,7 +25,7 @@ graph_parallel, mpi, python
- Manually
```
# clone the repo
git clone -b 1.81.0 https://github.com/apotocki/boost-iosx
git clone -b 1.82.0 https://github.com/apotocki/boost-iosx
# build libraries
cd boost-iosx
Expand All @@ -37,14 +37,14 @@ graph_parallel, mpi, python
- Use cocoapods. Add the following lines into your project's Podfile:
```
use_frameworks!
pod 'boost-iosx', '~> 1.81.0'
pod 'boost-iosx', '~> 1.82.0'
# or optionally more precisely e.g.:
# pod 'boost-iosx', :git => 'https://github.com/apotocki/boost-iosx', :tag => '1.81.0.3'
# pod 'boost-iosx', :git => 'https://github.com/apotocki/boost-iosx', :tag => '1.82.0.0'
```
If you want to use particular boost libraries, specify them as in the following example for log and program_options libraries:
```
pod 'boost-iosx/log', '~> 1.81.0'
pod 'boost-iosx/program_options', '~> 1.81.0'
pod 'boost-iosx/log', '~> 1.82.0'
pod 'boost-iosx/program_options', '~> 1.82.0'
# note: Some libraries have dependencies on other Boost libraries. In that case, you should explicitly add all their dependencies to your Podfile.
```
Then install new dependencies:
Expand Down
2 changes: 1 addition & 1 deletion boost-iosx.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "boost-iosx"
s.version = "1.81.0.3"
s.version = "1.82.0.0"
s.summary = "Boost C++ libraries"
s.homepage = "https://github.com/apotocki/boost-iosx"
s.license = "Boost Software License"
Expand Down
2 changes: 1 addition & 1 deletion scripts/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ platform :osx, '12.0'

target 'ICUdep' do
use_frameworks!
pod 'icu4c-iosx'
pod 'icu4c-iosx', :git => 'https://github.com/apotocki/icu4c-iosx', :submodules => 'true'
end
43 changes: 28 additions & 15 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
################## SETUP BEGIN
THREAD_COUNT=$(sysctl hw.ncpu | awk '{print $2}')
XCODE_ROOT=$( xcode-select -print-path )
BOOST_VER=1.81.0
BOOST_VER=1.82.0
################## SETUP END
DEVSYSROOT=$XCODE_ROOT/Platforms/iPhoneOS.platform/Developer
SIMSYSROOT=$XCODE_ROOT/Platforms/iPhoneSimulator.platform/Developer
Expand Down Expand Up @@ -34,6 +34,7 @@ if [[ ! -f boost/b2 ]]; then
fi

############### ICU
if true; then
#export ICU4C_RELEASE_LINK=https://github.com/apotocki/icu4c-iosx/releases/download/72.1.1
if [[ ! -d $SCRIPT_DIR/Pods/icu4c-iosx/product ]]; then
if [[ ! -z "${ICU4C_RELEASE_LINK}" ]]; then
Expand Down Expand Up @@ -62,12 +63,13 @@ if [[ ! -d $SCRIPT_DIR/Pods/icu4c-iosx/product ]]; then
pushd $SCRIPT_DIR
pod repo update
pod install --verbose
pod update --verbose
#pod update --verbose
popd
fi
mkdir $SCRIPT_DIR/Pods/icu4c-iosx/product/lib
fi
ICU_PATH=$SCRIPT_DIR/Pods/icu4c-iosx/product
fi
############### ICU

pushd boost
Expand Down Expand Up @@ -97,8 +99,11 @@ patch tools/build/src/tools/features/instruction-set-feature.jam $SCRIPT_DIR/ins

LIBS_TO_BUILD="--with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave --with-url"

B2_BUILD_OPTIONS="-j$THREAD_COUNT -sICU_PATH=\"$ICU_PATH\" address-model=64 release link=static runtime-link=shared define=BOOST_SPIRIT_THREADSAFE cxxflags=\"-std=c++20\""
B2_BUILD_OPTIONS="-j$THREAD_COUNT address-model=64 release link=static runtime-link=shared define=BOOST_SPIRIT_THREADSAFE cxxflags=\"-std=c++20\""

if [[ ! -z "${ICU_PATH}" ]]; then
B2_BUILD_OPTIONS="$B2_BUILD_OPTIONS -sICU_PATH=\"$ICU_PATH\""
fi

if true; then
if [[ -d bin.v2 ]]; then
Expand Down Expand Up @@ -142,9 +147,11 @@ using darwin : : clang++ -arch $1 -isysroot $MACSYSROOT/SDKs/MacOSX.sdk
: <architecture>$(boost_arc $1)
;
EOF
cp $ICU_PATH/frameworks/icudata.xcframework/macos-*/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/macos-*/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/macos-*/libicuuc.a $ICU_PATH/lib/
if [[ ! -z "${ICU_PATH}" ]]; then
cp $ICU_PATH/frameworks/icudata.xcframework/macos-*/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/macos-*/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/macos-*/libicuuc.a $ICU_PATH/lib/
fi
./b2 -j8 --stagedir=stage/macosx-$1 toolset=darwin architecture=$(boost_arc $1) abi=$(boost_abi $1) $B2_BUILD_OPTIONS $LIBS_TO_BUILD
rm -rf bin.v2
}
Expand All @@ -160,9 +167,11 @@ using darwin : catalyst : clang++ -arch $1 --target=$2 -isysroot $MACSYSROOT/SDK
: <architecture>$(boost_arc $1)
;
EOF
cp $ICU_PATH/frameworks/icudata.xcframework/ios-*-maccatalyst/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/ios-*-maccatalyst/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/ios-*-maccatalyst/libicuuc.a $ICU_PATH/lib/
if [[ ! -z "${ICU_PATH}" ]]; then
cp $ICU_PATH/frameworks/icudata.xcframework/ios-*-maccatalyst/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/ios-*-maccatalyst/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/ios-*-maccatalyst/libicuuc.a $ICU_PATH/lib/
fi
./b2 --stagedir=stage/catalyst-$1 toolset=darwin-catalyst architecture=$(boost_arc $1) abi=$(boost_abi $1) $B2_BUILD_OPTIONS $LIBS_TO_BUILD
rm -rf bin.v2
}
Expand All @@ -178,9 +187,11 @@ using darwin : ios : clang++ -arch arm64 -fembed-bitcode -isysroot $DEVSYSROOT/S
: <architecture>arm <target-os>iphone
;
EOF
cp $ICU_PATH/frameworks/icudata.xcframework/ios-arm64/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/ios-arm64/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/ios-arm64/libicuuc.a $ICU_PATH/lib/
if [[ ! -z "${ICU_PATH}" ]]; then
cp $ICU_PATH/frameworks/icudata.xcframework/ios-arm64/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/ios-arm64/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/ios-arm64/libicuuc.a $ICU_PATH/lib/
fi
./b2 --stagedir=stage/ios toolset=darwin-ios instruction-set=arm64 architecture=arm binary-format=mach-o abi=aapcs target-os=iphone define=_LITTLE_ENDIAN define=BOOST_TEST_NO_MAIN $B2_BUILD_OPTIONS $LIBS_TO_BUILD
rm -rf bin.v2
}
Expand All @@ -197,9 +208,11 @@ using darwin : iossim : clang++ -arch $1 -fembed-bitcode-marker -isysroot $SIMSY
: <architecture>$(boost_arc $1) <target-os>iphone
;
EOF
cp $ICU_PATH/frameworks/icudata.xcframework/ios-*-simulator/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/ios-*-simulator/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/ios-*-simulator/libicuuc.a $ICU_PATH/lib/
if [[ ! -z "${ICU_PATH}" ]]; then
cp $ICU_PATH/frameworks/icudata.xcframework/ios-*-simulator/libicudata.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icui18n.xcframework/ios-*-simulator/libicui18n.a $ICU_PATH/lib/
cp $ICU_PATH/frameworks/icuuc.xcframework/ios-*-simulator/libicuuc.a $ICU_PATH/lib/
fi
./b2 --stagedir=stage/iossim-$1 toolset=darwin-iossim architecture=$(boost_arc $1) abi=$(boost_abi $1) target-os=iphone define=BOOST_TEST_NO_MAIN $B2_BUILD_OPTIONS $LIBS_TO_BUILD
rm -rf bin.v2
}
Expand Down

0 comments on commit a400ddc

Please sign in to comment.