|
3 | 3 | # Safety check - Pillow builds require that CIBW_ARCHS is set, and that it only |
4 | 4 | # contains a single value (even though cibuildwheel allows multiple values in |
5 | 5 | # CIBW_ARCHS). |
6 | | -if [[ -z "$CIBW_ARCHS" ]]; then |
7 | | - echo "ERROR: Pillow builds require CIBW_ARCHS be defined." |
8 | | - exit 1 |
9 | | -fi |
10 | | -if [[ "$CIBW_ARCHS" == *" "* ]]; then |
11 | | - echo "ERROR: Pillow builds only support a single architecture in CIBW_ARCHS." |
12 | | - exit 1 |
13 | | -fi |
| 6 | +echo "ENV CHECK: CIBW_ARCHS=$CIBW_ARCHS" |
| 7 | +function check_cibw_archs { |
| 8 | + if [[ -z "$CIBW_ARCHS" ]]; then |
| 9 | + echo "ERROR: Pillow builds require CIBW_ARCHS be defined." |
| 10 | + exit 1 |
| 11 | + fi |
| 12 | + if [[ "$CIBW_ARCHS" == *" "* ]]; then |
| 13 | + echo "ERROR: Pillow builds only support a single architecture in CIBW_ARCHS." |
| 14 | + exit 1 |
| 15 | + fi |
| 16 | +} |
14 | 17 |
|
15 | 18 | # Setup that needs to be done before multibuild utils are invoked. Process |
16 | 19 | # potential cross-build platforms before native platforms to ensure that we pick |
17 | 20 | # up the cross environment. |
18 | 21 | PROJECTDIR=$(pwd) |
19 | 22 | if [[ "$CIBW_PLATFORM" == "ios" ]]; then |
| 23 | + check_cibw_archs |
20 | 24 | # On iOS, CIBW_ARCHS is actually a multi-arch - arm64_iphoneos, |
21 | 25 | # arm64_iphonesimulator or x86_64_iphonesimulator. Split into the CPU |
22 | 26 | # platform, and the iOS SDK. |
@@ -65,6 +69,7 @@ if [[ "$CIBW_PLATFORM" == "ios" ]]; then |
65 | 69 | HOST_MESON_FLAGS="--cross-file $WORKDIR/meson-cross.txt -Dprefer_static=true -Ddefault_library=static" |
66 | 70 |
|
67 | 71 | elif [[ "$(uname -s)" == "Darwin" ]]; then |
| 72 | + check_cibw_archs |
68 | 73 | # Build macOS dependencies in `build/darwin` |
69 | 74 | # Install them into `build/deps/darwin` |
70 | 75 | PLAT="${CIBW_ARCHS:-$AUDITWHEEL_ARCH}" |
|
0 commit comments