setup.py
changeset 49956 ff4df0954742
parent 49879 dd804d83822c
child 49972 1bd33932713d
--- a/setup.py	Thu Jan 26 00:23:07 2023 +0100
+++ b/setup.py	Sat Jan 28 20:08:57 2023 +0100
@@ -1454,11 +1454,13 @@
         target = [target_dir]
         target.extend(self.name.split('.'))
         target[-1] += DYLIB_SUFFIX
+        target = os.path.join(*target)
+        os.makedirs(os.path.dirname(target), exist_ok=True)
         shutil.copy2(
             os.path.join(
                 self.rusttargetdir, self.dylibname + self.rustdylibsuffix()
             ),
-            os.path.join(*target),
+            target,
         )