Skip to content

Commit

Permalink
Let ARCHFLAGS environment variable handle the architecture (avoid -ar…
Browse files Browse the repository at this point in the history
…ch flag directly to compile/link args)
  • Loading branch information
jfranmatheu committed Feb 12, 2025
1 parent 480249c commit d906f45
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cy_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ def build_for_architecture(arch):

# Add architecture flags only for macOS
if platform.system() == 'Darwin' and arch:
# Let ARCHFLAGS environment variable handle the architecture
# Don't add -arch flag directly to compile/link args
if 'ARCHFLAGS' not in os.environ:
os.environ['ARCHFLAGS'] = f'-arch {arch}'
if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ:
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.15' # minimum macOS version
extra_compile_args.append(f'-arch {arch}')
extra_link_args.append(f'-arch {arch}')

shared_ext_kwargs = {
'extra_compile_args': extra_compile_args,
Expand Down

0 comments on commit d906f45

Please sign in to comment.