Skip to content

Commit a8e3a99

Browse files
kkraus14cursoragent
andcommitted
Move clang detection to build_extensions for single check
Check the compiler once in build_extensions (plural) and fix up all extensions in one pass, instead of checking per-extension in build_extension (singular). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cadd2f2 commit a8e3a99

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cuda_bindings/setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ class build_ext(_build_ext):
4040
def build_extensions(self):
4141
if nthreads > 0:
4242
self.parallel = nthreads
43-
super().build_extensions()
44-
45-
def build_extension(self, ext):
4643
if _is_clang(self.compiler):
47-
ext.extra_compile_args = [a for a in ext.extra_compile_args if a != "-fno-var-tracking-assignments"]
48-
super().build_extension(ext)
44+
for ext in self.extensions:
45+
ext.extra_compile_args = [a for a in ext.extra_compile_args if a != "-fno-var-tracking-assignments"]
46+
super().build_extensions()
4947

5048

5149
setup(

0 commit comments

Comments
 (0)