[pygobject] setup.py: dedup some of the compiler input args



commit 82c1c0c3cf5090d2f9fd72d0520abba35b7b04e9
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Mon Apr 23 08:57:49 2018 +0200

    setup.py: dedup some of the compiler input args
    
    reduces the output at build time a bit

 setup.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/setup.py b/setup.py
index 906ded54..b6729eb2 100755
--- a/setup.py
+++ b/setup.py
@@ -860,16 +860,21 @@ def add_ext_pkg_config_dep(ext, compiler_type, name):
         "libffi": ["ffi"],
     }
 
+    def add(target, new):
+        for entry in new:
+            if entry not in target:
+                target.append(entry)
+
     fallback_libs = msvc_libraries[name]
     if compiler_type == "msvc":
         # assume that INCLUDE and LIB contains the right paths
-        ext.libraries += fallback_libs
+        add(ext.libraries, fallback_libs)
     else:
         min_version = get_version_requirement(name)
         pkg_config_version_check(name, min_version)
-        ext.include_dirs += pkg_config_parse("--cflags-only-I", name)
-        ext.library_dirs += pkg_config_parse("--libs-only-L", name)
-        ext.libraries += pkg_config_parse("--libs-only-l", name)
+        add(ext.include_dirs, pkg_config_parse("--cflags-only-I", name))
+        add(ext.library_dirs, pkg_config_parse("--libs-only-L", name))
+        add(ext.libraries, pkg_config_parse("--libs-only-l", name))
 
 
 def add_ext_compiler_flags(ext, compiler, _cache={}):


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