Feat/m1 manual build (#936)

* feat(bindings): move target compilation flags to correct config file

* feat(bindings): m1 build 'script'

* feat(ci): for loop in bdist_wheel script for m1

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
This commit is contained in:
Luc Georges
2022-03-02 14:44:13 +01:00
committed by GitHub
parent 03e10b606d
commit 845da6d8e8
3 changed files with 24 additions and 5 deletions

View File

@ -0,0 +1,14 @@
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
"-C", "link-arg=-mmacosx-version-min=10.11",
]
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
"-C", "link-arg=-mmacosx-version-min=10.11",
]

View File

@ -30,8 +30,4 @@ tempfile = "3.1"
[features]
default = ["pyo3/extension-module"]
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

View File

@ -0,0 +1,9 @@
#! /bin/bash
for VARIABLE in "3.7.12" "3.8.12" "3.9.10" "3.10.2"
do
MACOSX_DEPLOYMENT_TARGET=10.11 SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" CFLAGS="-I/usr/include/openssl -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" CPPFLAGS="-I/usr/local/opt/zlib/include" LDFLAGS="-L/usr/lib -L/usr/local/opt/readline/lib" pyenv install $VARIABLE
~/.pyenv/versions/$VARIABLE/bin/pip install setuptools wheel setuptools-rust==0.11.3 --ignore-installed --force-reinstall
MACOSX_DEPLOYMENT_TARGET=10.11 ~/.pyenv/versions/$VARIABLE/bin/python setup.py bdist_wheel
done