Tweak include/lib dir detection in ffi.py

Joint work with @carlosmn
This commit is contained in:
Jasper Lievisse Adriaanse
2014-07-03 10:10:38 +02:00
parent 1d509c1109
commit b0bf223276

View File

@@ -112,11 +112,11 @@ with codecs.open(decl_path, 'r', 'utf-8') as header:
# if LIBGIT2 exists, set build and link against that version
libgit2_path = getenv('LIBGIT2')
include_dirs = []
library_dirs = []
if libgit2_path:
include_dirs = [path.join(libgit2_path, 'include')]
library_dirs = [path.join(libgit2_path, 'lib')]
if not libgit2_path:
libgit2_path = '/usr/local'
include_dirs = [path.join(libgit2_path, 'include')]
library_dirs = [path.join(libgit2_path, 'lib')]
C = ffi.verify("#include <git2.h>", libraries=["git2"],
include_dirs=include_dirs, library_dirs=library_dirs)