@@ -76,7 +76,7 @@ def build_extension(self, ext):
76
76
raise NotImplementedError (
77
77
f"Unsupported platform: { sys .platform } " )
78
78
else :
79
- isa_l_prefix_dir = build_isa_l ()
79
+ isa_l_prefix_dir = build_isa_l (" " . join ( self . compiler . compiler ) )
80
80
if SYSTEM_IS_UNIX :
81
81
ext .extra_objects = [
82
82
os .path .join (isa_l_prefix_dir , "lib" , "libisal.a" )]
@@ -113,7 +113,7 @@ def build_extension(self, ext):
113
113
# 'cache' is only available from python 3.9 onwards.
114
114
# see: https://docs.python.org/3/library/functools.html#functools.cache
115
115
@functools .lru_cache (maxsize = None )
116
- def build_isa_l ():
116
+ def build_isa_l (compiler ):
117
117
# Creating temporary directories
118
118
build_dir = tempfile .mktemp ()
119
119
temp_prefix = tempfile .mkdtemp ()
@@ -123,7 +123,7 @@ def build_isa_l():
123
123
# it.
124
124
build_env = os .environ .copy ()
125
125
# Add -fPIC flag to allow static compilation
126
- build_env ["CFLAGS " ] = build_env . get ( "CFLAGS" , "" ) + " -fPIC"
126
+ build_env ["CC " ] = compiler + " -fPIC"
127
127
if hasattr (os , "sched_getaffinity" ):
128
128
cpu_count = len (os .sched_getaffinity (0 ))
129
129
else : # sched_getaffinity not available on all platforms
0 commit comments