Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for ARM builds #134

Merged
merged 4 commits into from
May 17, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 32 additions & 18 deletions setup-build-freetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import urllib
from os import path
from urllib.request import urlopen
import platform

# Needed for the GitHub Actions macOS CI runner, which appears to come without CAs.
import certifi
Expand Down Expand Up @@ -78,27 +79,40 @@
bitness = 64

if "linux" in sys.platform:
c_flags = cxx_flags = "-O2"
ld_flags = ""
if (
os.environ.get("PYTHON_ARCH", "") == "32"
or os.environ.get("PLAT", "") == "i686"
platform.machine == "x86_64"
or platform.machine == "x86"
):
print("# Making a 32 bit build.")
# On a 64 bit Debian/Ubuntu, this needs gcc-multilib and g++-multilib.
# On a 64 bit Fedora, install glibc-devel and libstdc++-devel.
CMAKE_GLOBAL_SWITCHES += (
'-DCMAKE_C_FLAGS="-m32 -O2" '
'-DCMAKE_CXX_FLAGS="-m32 -O2" '
'-DCMAKE_LD_FLAGS="-m32" '
)
bitness = 32
if (
os.environ.get("PYTHON_ARCH", "") == "32"
or platform.architecture() == "32bit"
):
print("# Making a 32 bit build.")
# On a 64 bit Debian/Ubuntu, this needs gcc-multilib and g++-multilib.
# On a 64 bit Fedora, install glibc-devel and libstdc++-devel.
c_flags = "-m32 {}".format(c_flags)
cxx_flags = "-m32 {}".format(cxx_flags)
ld_flags = "-m32"
bitness = 32
else:
print("# Making a 64 bit build.")
c_flags = "-m64 {}".format(c_flags)
cxx_flags = "-m64 {}".format(cxx_flags)
ld_flags = "-m64"
bitness = 64
else:
print("# Making a 64 bit build.")
CMAKE_GLOBAL_SWITCHES += (
'-DCMAKE_C_FLAGS="-m64 -O2" '
'-DCMAKE_CXX_FLAGS="-m64 -O2" '
'-DCMAKE_LD_FLAGS="-m64" '
)
bitness = 64
print("# Making a '{}' build.".format(platform.machine()))
if platform.architecture() == "32bit":
bitness = 32
else:
bitness = 64
CMAKE_GLOBAL_SWITCHES += (
'-DCMAKE_C_FLAGS="{}" '.format(c_flags) +
'-DCMAKE_CXX_FLAGS="{}" '.format(cxx_flags) +
'-DCMAKE_LD_FLAGS="{}" '.format(ld_flags)
)


def shell(cmd, cwd=None):
Expand Down