Skip to content

Commit dd99c40

Browse files
Only add extra arguments when using macOS universal builds.
1 parent 2f740ee commit dd99c40

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

doc/src/release_notes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Thin Mode Changes
2121
`tcp`, a more meaningful exception is now raised:
2222
`DPY-2029: https_proxy requires use of the tcps protocol`.
2323

24+
Common Changes
25+
++++++++++++++
26+
27+
#) The compiler flag ``-arch x86_64`` no longer needs to be explicitly
28+
specified when building from source code on macOS (Intel x86) without
29+
Universal Python binaries.
30+
#) Improved samples and documentation.
31+
2432

2533
oracledb 1.0.1 (June 2022)
2634
--------------------------

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import os
2626
import platform
2727
import sys
28+
import sysconfig
2829
from setuptools import setup, Extension
2930

3031
# base source directory
@@ -61,11 +62,10 @@
6162
thin_depends.append(base_pxd)
6263

6364
# if the platform is macOS, add arguments required for cross-compilation for
64-
# both x86_64 and arm64 architectures.
65-
# Use a Universal 2 Python binary to build, or set an archtecture
66-
# before building, e.g. export ARCHFLAGS="-arch x86_64"
65+
# both x86_64 and arm64 architectures if the python interpreter is a
66+
# universal2 version.
6767
extra_compile_args = []
68-
if sys.platform == "darwin":
68+
if sys.platform == "darwin" and "universal2" in sysconfig.get_platform():
6969
if platform.machine() == "x86_64":
7070
target = "arm64-apple-macos"
7171
else:

0 commit comments

Comments
 (0)