From 8246228c4c4f402ec392332f19ebbf7272709101 Mon Sep 17 00:00:00 2001 From: 0xE1E10 Date: Mon, 14 Nov 2016 01:10:03 -0800 Subject: [PATCH] Fix build problems with CPATH and cppnanomsg. (#39) * Fix build problems with CPATH and cppnanomsg. * Switch to simple endswith for the filename check. --- generate.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generate.py b/generate.py index c7c46bb..850433a 100644 --- a/generate.py +++ b/generate.py @@ -25,7 +25,8 @@ def header_files(include_paths): for dir in include_paths: if os.path.exists(dir): break - return {fn: os.path.join(dir, fn) for fn in os.listdir(dir)} + return {fn: os.path.join(dir, fn) for fn in os.listdir(dir) + if fn.endswith('.h')} def functions(hfiles): @@ -96,8 +97,8 @@ def create_module(): if 'CPATH' in os.environ: cpaths = os.getenv('CPATH').split(os.pathsep) - site_cfg['include_dirs'] += [os.path.join(p, 'nanomsg') - for p in cpaths] + set_source_args['include_dirs'] += [os.path.join(p, 'nanomsg') + for p in cpaths] hfiles = header_files(set_source_args['include_dirs']) # remove ws.h due to https://github.com/nanomsg/nanomsg/issues/467