diff options
author | David Robillard <d@drobilla.net> | 2017-12-26 11:00:45 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-26 11:00:45 -0500 |
commit | 8baf9f0ed7552f98fc0aeaa545dffb818031f70a (patch) | |
tree | 6b429a31e002f6e354c249918e8cf30c7eaee449 | |
parent | d9f2bd6d383cea07388c84049bb511358d70aa57 (diff) | |
download | autowaf-8baf9f0ed7552f98fc0aeaa545dffb818031f70a.tar.gz autowaf-8baf9f0ed7552f98fc0aeaa545dffb818031f70a.tar.bz2 autowaf-8baf9f0ed7552f98fc0aeaa545dffb818031f70a.zip |
Factor out get_check_func
-rw-r--r-- | autowaf.py | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -93,23 +93,21 @@ def set_options(opt, debug_by_default=False, test=False): g_step = 1 -def check_header(conf, lang, name, define='', mandatory=True): - "Check for a header" - includes = '' # search default system include paths - if sys.platform == "darwin": - includes = '/opt/local/include' - +def get_check_func(conf, lang): if lang == 'c': - check_func = conf.check_cc + return conf.check_cc elif lang == 'cxx': - check_func = conf.check_cxx + return conf.check_cxx else: Logs.error("Unknown header language `%s'" % lang) - return +def check_header(conf, lang, name, define='', mandatory=True): + "Check for a header" + check_func = get_check_func(conf, lang) if define != '': - check_func(header_name=name, includes=includes, - define_name=define, mandatory=mandatory) + check_func(header_name=name, + define_name=define, + mandatory=mandatory) else: check_func(header_name=name, includes=includes, mandatory=mandatory) |