Skip to content

Commit 4bf558b

Browse files
committed
Use gcc-specific _compile method for triplet-gcc as well
On debian bookworm, distutils invokes gcc as x86_64-linux-gnu-gcc, so allow command line elements ending in "-gcc" as well as command line elements being exactly "gcc".
1 parent f7c0165 commit 4bf558b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
3333
cc_args = cc_args + ['-std=c99'] if src.endswith('.c') else cc_args
3434
return _compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
3535

36-
if c.compiler_type == 'unix' and 'gcc' in c.compiler:
36+
if c.compiler_type == 'unix' and \
37+
any(item == 'gcc' or item.endswith("-gcc") for item in c.compiler):
3738
c._compile = c_compile
3839

3940
elif self.compiler.compiler_type == "msvc":

0 commit comments

Comments
 (0)