Skip to content

cflags_other is never used when compiling extensions

This is related to exporting the --pthread in the CFLAGS variable to make sure we can compile against blitz. but a look at:

$ pkg-config --cflags-only-other blitz
-pthread 

revealed that bob.extension is ignoring this flag. Even though such method exists: https://www.idiap.ch/software/bob/docs/latest/bob/bob.extension/master/py_api.html#bob.extension.pkgconfig.cflags_other but it was never used. A quick and dirty patch (see below) fixes the problem but I'll leave that to you @andre.anjos to implement this properly.

diff --git a/bob/extension/__init__.py b/bob/extension/__init__.py
index ed11362..593f599 100644
--- a/bob/extension/__init__.py
+++ b/bob/extension/__init__.py
@@ -408,6 +408,7 @@ class Extension(DistutilsExtension):
       self.pkg_libraries += libs
 
       parameters['extra_link_args'] += pkg.other_libraries()
+      parameters['extra_compile_args'].extend(pkg.cflags_other().get('extra_compile_args', []))
 
     # add the -isystem to all system include dirs
     for k in system_includes: