Skip to content

Commit

Permalink
Move flags envs and install
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMilardo authored Jul 3, 2024
1 parent a9c09b6 commit 16822ed
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,38 @@ jobs:
with:
platforms: all

- name: Install llvm@18
if: matrix.platform == 'macos-intel' || matrix.platform == 'macos-arm'

- name: Link LLVM@18
if: matrix.platform == 'macos-intel'
run: |
brew install llvm@18
echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L$(brew --prefix)/opt/llvm/lib -L$(brew --prefix)/opt/llvm/lib/c++ -L/opt/homebrew/lib -Wl,-rpath,$(brew --prefix)/opt/llvm/lib/c++" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm/include -I/opt/homebrew/include -fexperimental-library" >> "$GITHUB_ENV"
echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> "$GITHUB_ENV"
echo "OBJC=clang" >> "$GITHUB_ENV"
echo "CC_LD=lld" >> "$GITHUB_ENV"
echo "CXX_LD=lld" >> "$GITHUB_ENV"
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
- name: Build wheels
if: matrix.platform != 'macos-arm'
uses: pypa/cibuildwheel@v2.19.1
env:
MACOSX_DEPLOYMENT_TARGET: 13.0
CIBW_ARCHS_LINUX: x86_64 aarch64
CC: clang
CXX: clang++
OBJC: clang
CC_LD: lld
CXX_LD: lld
OBJC_LD: lld


- name: Build wheels
if: matrix.platform == 'macos-arm'
uses: pypa/cibuildwheel@v2.19.1
env:
MACOSX_DEPLOYMENT_TARGET: 14.0
CC: clang
CXX: clang++
OBJC: clang
CC_LD: lld
CXX_LD: lld
OBJC_LD: lld

- name: Verify clean directory
run: git diff --exit-code
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ apk add openssl-dev
before-all = """
brew install openssl@1.1
brew install --ignore-dependencies asio
brew install llvm@18
brew link --overwrite -f llvm@18
"""
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@
prefix = run(["brew", "--prefix"], capture_output=True).stdout.decode("utf-8")[:-1]
include_dirs.append(f"{prefix}/opt/openssl@1.1/include")
include_dirs.append(f"{prefix}/include")
include_dirs.append(f"{prefix}/opt/llvm/include")
extra_link_args.insert(0, f"-L{prefix}/lib")
extra_link_args.insert(0, f"-L{prefix}/opt/openssl@1.1/lib")
extra_link_args.insert(0, f"-L{prefix}/opt/llvm/lib")
extra_link_args.insert(0, f"-L{prefix}/opt/llvm/lib/c++")
extra_link_args.append(f"-Wl,-rpath,{prefix}/opt/llvm/lib/c++")
extra_compile_args.append("-fexperimental-library")

# try conan dependency resolution
conanfile = tuple(Path(__file__).parent.resolve().rglob("conanbuildinfo.json"))
Expand Down

0 comments on commit 16822ed

Please sign in to comment.