[pygobject] setup.py: convince distutils to build dylibs on macOS



commit 3d4bc64461c7c59f5e4aaabe7f2752d6ece83ed0
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Mon Feb 5 22:55:04 2018 +0100

    setup.py: convince distutils to build dylibs on macOS
    
    This makes the "build_tests" command work

 setup.py | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/setup.py b/setup.py
index 44d65149..918a5654 100755
--- a/setup.py
+++ b/setup.py
@@ -265,6 +265,13 @@ class build_tests(Command):
             # XXX: something broken with mingw python2
             compiler.shared_lib_extension = ".dll"
 
+        if sys.platform == "darwin":
+            compiler.shared_lib_extension = ".dylib"
+            if "-bundle" in compiler.linker_so:
+                compiler.linker_so = list(compiler.linker_so)
+                i = compiler.linker_so.index("-bundle")
+                compiler.linker_so[i] = "-dynamiclib"
+
         def build_ext(ext):
             if compiler.compiler_type == "msvc":
                 raise Exception("MSVC support not implemented")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]