Skip to content

Commit b75323d

Browse files
committed
COMP: Re-factor macpython-build-wheels.sh to pass build options to libtbb
This commit is a follow up of: * 374c744 (ENH: Add macOS wheel TBB support) * 037a326 (ENH: Build macOS module wheels with TBB support) It ensures the "ITK-source" project (which effectively build the tbb library in addition of downloading the ITK sources) is built with the options specific for building (e.g CMAKE_BUILD_TYPE and CMAKE_OSX_*)
1 parent d44a837 commit b75323d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/macpython-build-wheels.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
5050
DELOCATE_WHEEL=${VENV}/bin/delocate-wheel
5151
DELOCATE_PATCH=${VENV}/bin/delocate-patch
5252

53+
build_type="Release"
54+
5355
if [[ $(arch) == "arm64" ]]; then
56+
osx_target="11.0"
57+
osx_arch="arm64"
5458
use_tbb="OFF"
5559
else
60+
osx_target="10.9"
61+
osx_arch="x86_64"
5662
use_tbb="ON"
5763
fi
64+
5865
# Build standalone project and populate archive cache
5966
tbb_dir=$PWD/oneTBB-prefix/lib/cmake/TBB
6067
# So delocate can find the libs
@@ -64,7 +71,10 @@ pushd ITK-source > /dev/null 2>&1
6471
${CMAKE_EXECUTABLE} -DITKPythonPackage_BUILD_PYTHON:PATH=0 \
6572
-DITKPythonPackage_USE_TBB:BOOL=${use_tbb} \
6673
-G Ninja \
74+
-DCMAKE_BUILD_TYPE:STRING=${build_type} \
6775
-DCMAKE_MAKE_PROGRAM:FILEPATH=${NINJA_EXECUTABLE} \
76+
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${osx_target} \
77+
-DCMAKE_OSX_ARCHITECTURES:STRING=${osx_arch} \
6878
${SCRIPT_DIR}/../
6979
${NINJA_EXECUTABLE}
7080
popd > /dev/null 2>&1
@@ -83,16 +93,11 @@ for VENV in "${VENVS[@]}"; do
8393

8494
${Python3_EXECUTABLE} -m pip install --upgrade -r ${SCRIPT_DIR}/../requirements-dev.txt
8595

86-
build_type="Release"
8796
if [[ $(arch) == "arm64" ]]; then
8897
plat_name="macosx-11.0-arm64"
89-
osx_target="11.0"
90-
osx_arch="arm64"
9198
build_path="${SCRIPT_DIR}/../ITK-${py_mm}-macosx_arm64"
9299
else
93100
plat_name="macosx-10.9-x86_64"
94-
osx_target="10.9"
95-
osx_arch="x86_64"
96101
build_path="${SCRIPT_DIR}/../ITK-${py_mm}-macosx_x86_64"
97102
fi
98103
if [[ ! -z "${MACOSX_DEPLOYMENT_TARGET}" ]]; then

0 commit comments

Comments
 (0)