py-torchaudio: fix build with Apple Clang 15+ (#47130)

This commit is contained in:
Adam J. Stewart 2024-10-22 23:31:38 +02:00 committed by GitHub
parent a53a14346e
commit 31694fe9bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,6 +116,13 @@ class PyTorchaudio(PythonPackage):
)
conflicts("^cuda@12.5:", when="@:2.1")
def flag_handler(self, name, flags):
# https://github.com/pytorch/vision/issues/8653
if name == "ldflags":
if self.spec.satisfies("%apple-clang@15:"):
flags.append("-Wl,-ld_classic")
return (flags, None, None)
def setup_build_environment(self, env):
# tools/setup_helpers/extension.py
env.set("BUILD_SOX", 0)