Skip to content

Commit

Permalink
fix gh action workflow and build issues
Browse files Browse the repository at this point in the history
1
  • Loading branch information
K0lb3 committed Sep 3, 2024
1 parent 8b1c661 commit 3def800
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest, windows-latest, macos-13]
cp: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]

name: Build ${{ matrix.cp }} wheels on ${{ matrix.os }}
Expand All @@ -48,19 +48,17 @@ jobs:
uses: joerick/[email protected]
env:
CIBW_ARCHS_LINUX: auto aarch64
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BUILD: |
${{ matrix.cp }}-manylinux_x86_64
${{ matrix.cp }}-manylinux_i686
${{ matrix.cp }}-manylinux_aarch64
${{ matrix.cp }}-win_amd64
${{ matrix.cp }}-win32
${{ matrix.cp }}-macosx_x86_64
${{ matrix.cp }}-macosx_arm64
${{ matrix.cp }}-macosx_universal2
CIBW_TEST_REQUIRES: setuptools pytest pillow imagehash texture2ddecoder
CIBW_TEST_COMMAND: pytest -v -s {package}/tests
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-win32 *_i686"
CIBW_TEST_SKIP: "*-macosx* *-manylinux_i686 *-win32"

- uses: actions/upload-artifact@v3
with:
Expand Down
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import os

ETCPAK_SOURCES = [
"bc7enc.cpp",
Expand Down Expand Up @@ -29,7 +28,6 @@
class CustomBuildExt(build_ext):
def build_extensions(self):
compiler_type = self.compiler.compiler_type

if compiler_type == "msvc":
# MSVC-specific compiler and linker flags
for ext in self.extensions:
Expand All @@ -38,18 +36,21 @@ def build_extensions(self):
"/std:c++20",
"/Zc:strictStrings-",
"/DNOMINMAX",
"/D__SSE4_1__",
"/D__AVX2__",
"/arch:AVX2",
"/GL",
]
)
if "-amd64" in self.plat_name:
ext.extra_compile_args.extend(
["/D__SSE4_1__", "/D__AVX2__", "/arch:AVX2"]
)
ext.extra_link_args = ["/LTCG:incremental"]
else:
# For other compilers (e.g., GCC or Clang)
cpu = os.uname().machine
if cpu in ("arm", "aarch64"):
native_arg = "-mcpu=native"
if "-arm" in self.plat_name or "-aarch64" in self.plat_name:
if "macosx" in self.plat_name:
native_arg = "-mcpu=apple-m1"
else:
native_arg = "-mcpu=native"
else:
native_arg = "-march=native"

Expand Down

0 comments on commit 3def800

Please sign in to comment.