summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-26 11:00:45 -0500
committerDavid Robillard <d@drobilla.net>2017-12-26 11:00:45 -0500
commit8baf9f0ed7552f98fc0aeaa545dffb818031f70a (patch)
tree6b429a31e002f6e354c249918e8cf30c7eaee449
parentd9f2bd6d383cea07388c84049bb511358d70aa57 (diff)
downloadautowaf-8baf9f0ed7552f98fc0aeaa545dffb818031f70a.tar.gz
autowaf-8baf9f0ed7552f98fc0aeaa545dffb818031f70a.tar.bz2
autowaf-8baf9f0ed7552f98fc0aeaa545dffb818031f70a.zip
Factor out get_check_func
-rw-r--r--autowaf.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/autowaf.py b/autowaf.py
index 64aa435..838fcc1 100644
--- a/autowaf.py
+++ b/autowaf.py
@@ -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)