1313# For example,
1414#
1515# export DYLD_LIBRARY_PATH="/path/to/libs"
16- # scripts/macpython-build-module-wheels.sh cp39
16+ # scripts/macpython-build-module-wheels.sh 3.9
1717#
1818
1919# -----------------------------------------------------------------------
@@ -50,11 +50,18 @@ DELOCATE_LISTDEPS=${VENV}/bin/delocate-listdeps
5050DELOCATE_WHEEL=${VENV} /bin/delocate-wheel
5151DELOCATE_PATCH=${VENV} /bin/delocate-patch
5252
53+ build_type=" Release"
54+
5355if [[ $( arch) == " arm64" ]]; then
56+ osx_target=" 11.0"
57+ osx_arch=" arm64"
5458 use_tbb=" OFF"
5559else
60+ osx_target=" 10.9"
61+ osx_arch=" x86_64"
5662 use_tbb=" ON"
5763fi
64+
5865# Build standalone project and populate archive cache
5966tbb_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}
7080popd > /dev/null 2>&1
@@ -83,18 +93,16 @@ 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
103+ if [[ ! -z " ${MACOSX_DEPLOYMENT_TARGET} " ]]; then
104+ osx_target=" ${MACOSX_DEPLOYMENT_TARGET} "
105+ fi
98106 source_path=${SCRIPT_DIR} /../ITK-source/ITK
99107 SETUP_PY_CONFIGURE=" ${script_dir} /setup_py_configure.py"
100108
0 commit comments