diff options
author | Michal Vyskocil <michal.vyskocil@gmail.com> | 2017-05-25 09:25:44 +0200 |
---|---|---|
committer | Michal Vyskocil <michal.vyskocil@gmail.com> | 2017-05-25 09:25:44 +0200 |
commit | e495b95d030e65cb3c4fd64720e826373e95db9c (patch) | |
tree | 45c6dd1bd2bdfa3949fcd42225b2f8b857bc1a35 /cffi | |
parent | b324ff9e7adc53b03f77ddd8d35b134e03b7d1cd (diff) | |
download | cffi-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.py | 7 |
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 |