File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -348,7 +348,19 @@ def _configure_for_architecture(self):
348348 self .config ['cmake_args' ] = ['-A' , arch_flag ]
349349
350350 elif self .platform_name == 'Darwin' : # macOS
351- if self .architecture == 'arm64' :
351+ # Check if CMAKE_OSX_ARCHITECTURES is already set in environment (e.g., by cibuildwheel)
352+ env_cmake_arch = os .environ .get ('CMAKE_OSX_ARCHITECTURES' )
353+ if env_cmake_arch :
354+ self .config ['cmake_args' ].append (f'-DCMAKE_OSX_ARCHITECTURES={ env_cmake_arch } ' )
355+ print (f"Using CMAKE_OSX_ARCHITECTURES from environment: { env_cmake_arch } " )
356+ # Update our internal architecture tracking to match environment
357+ if env_cmake_arch == 'arm64' :
358+ self .architecture = 'arm64'
359+ print ("Configuring for Apple Silicon (ARM64) - from environment" )
360+ else :
361+ self .architecture = 'x64'
362+ print ("Configuring for Intel Mac (x86_64) - from environment" )
363+ elif self .architecture == 'arm64' :
352364 # Apple Silicon - set CMAKE_OSX_ARCHITECTURES
353365 self .config ['cmake_args' ].append ('-DCMAKE_OSX_ARCHITECTURES=arm64' )
354366 print ("Configuring for Apple Silicon (ARM64)" )
You can’t perform that action at this time.
0 commit comments