File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -143,18 +143,12 @@ def build_extension(self, ext: CMakeExtension):
143143 if tbb_libs :
144144 print (f"Found TBB libraries: { tbb_libs } " )
145145 for lib in tbb_libs :
146- # We only want the real shared object, not symlinks if possible,
147- # but copying everything matching the pattern is safer to ensure we get the versioned one.
148- # However, we need to be careful not to overwrite if multiple matches found.
149- # Usually we want the one that the linker linked against.
150- # Since we set RPATH to $ORIGIN (Linux) or @loader_path (macOS), we need the library in the same dir as the extension.
151-
152- # Avoid copying if it's a symlink pointing to something we already copied?
153- # simpler: just copy all of them.
154- dest = extdir / lib .name
146+ # Only copy real files, not symlinks. If it's a symlink, copy its target.
147+ target_lib = lib .resolve () if lib .is_symlink () else lib
148+ dest = extdir / target_lib .name
155149 if not dest .exists ():
156- shutil .copy2 (lib , dest )
157- print (f"Copied { lib } to { dest } " )
150+ shutil .copy2 (target_lib , dest , follow_symlinks = True )
151+ print (f"Copied { target_lib } to { dest } " )
158152 else :
159153 print ("Warning: No TBB shared libraries found to copy." )
160154
You can’t perform that action at this time.
0 commit comments