summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-04-23 08:57:49 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2018-04-23 15:34:17 +0200
commit82c1c0c3cf5090d2f9fd72d0520abba35b7b04e9 (patch)
tree01ff88c6721cb8fdc9383cf2042ad62d54d36001 /setup.py
parentaff665b7a5ec156c55eff258be5b38e608e05b36 (diff)
downloadpygobject-82c1c0c3cf5090d2f9fd72d0520abba35b7b04e9.tar.gz
setup.py: dedup some of the compiler input args
reduces the output at build time a bit
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py13
1 files 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={}):