summaryrefslogtreecommitdiff
path: root/cffi
diff options
context:
space:
mode:
authorMichal Vyskocil <michal.vyskocil@gmail.com>2017-05-25 09:25:44 +0200
committerMichal Vyskocil <michal.vyskocil@gmail.com>2017-05-25 09:25:44 +0200
commite495b95d030e65cb3c4fd64720e826373e95db9c (patch)
tree45c6dd1bd2bdfa3949fcd42225b2f8b857bc1a35 /cffi
parentb324ff9e7adc53b03f77ddd8d35b134e03b7d1cd (diff)
downloadcffi-e495b95d030e65cb3c4fd64720e826373e95db9c.tar.gz
can't link with libraries expects -pthreads or similar flags
read extra_compile_args and extra_link_args fom pkg-config too
Diffstat (limited to 'cffi')
-rw-r--r--cffi/pkgconfig.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cffi/pkgconfig.py b/cffi/pkgconfig.py
index 55cb085..6396958 100644
--- a/cffi/pkgconfig.py
+++ b/cffi/pkgconfig.py
@@ -48,6 +48,9 @@ def pkgconfig_kwargs (libs):
return tuple (string [2:].split ('=', 2))
return [_macros (x) for x in string.split () if x.startswith ("-D")]
+ def drop_macros (string):
+ return [x for x in string.split () if not x.startswith ("-D")]
+
# pkg-config call
def pc (libname, *args):
a = ["pkg-config", "--print-errors"]
@@ -61,7 +64,9 @@ def pkgconfig_kwargs (libs):
"include_dirs" : dropILl (pc (libname, "--cflags-only-I")),
"library_dirs" : dropILl (pc (libname, "--libs-only-L")),
"libraries" : dropILl (pc (libname, "--libs-only-l")),
- "define_macros" : macros (pc (libname, "--cflags")),
+ "define_macros" : macros (pc (libname, "--cflags-only-other")),
+ "extra_compile_args" : drop_macros (pc (libname, "--cflags-only-other")),
+ "extra_link_args" : pc (libname, "--libs-only-other").split ()
}
# merge all arguments together