yet another waf/HIDAPI tweak

This commit is contained in:
Robin Gareus 2016-10-27 15:57:47 +02:00
parent 01747f54d8
commit 8de0788f7b

View file

@ -24,21 +24,22 @@ def configure(conf):
else: else:
if conf.env['build_target'] == 'mingw': if conf.env['build_target'] == 'mingw':
conf.check (compiler='cxx', lib='setupapi', mandatory=True, uselib_store='SETUPAPI') conf.check (compiler='cxx', lib='setupapi', mandatory=True, uselib_store='SETUPAPI')
if conf.is_defined('HAVE_SETUPAPI'): conf.define ('HAVE_HIDAPI', 1)
conf.define ('HAVE_HIDAPI', 1) elif sys.platform == 'darwin':
conf.define ('HAVE_HIDAPI', 1)
elif re.search ("linux", sys.platform) != None: elif re.search ("linux", sys.platform) != None:
autowaf.check_pkg(conf, 'libudev', uselib_store='UDEV', mandatory=False) autowaf.check_pkg(conf, 'libudev', uselib_store='UDEV', mandatory=False)
if conf.is_defined('HAVE_UDEV'): if conf.is_defined('HAVE_UDEV'):
conf.define ('HAVE_HIDAPI', 1) conf.define ('HAVE_HIDAPI', 1)
else: else:
conf.define ('HAVE_HIDAPI', 1) print ("hidapi is not yet available for the given system")
conf.load('compiler_c') conf.load('compiler_c')
autowaf.configure(conf) autowaf.configure(conf)
def build(bld): def build(bld):
if bld.is_defined('USE_EXTERNAL_LIBS'): if bld.is_defined('USE_EXTERNAL_LIBS'):
return return
if not bld.get_define('HAVE_HIDAPI'): if not bld.is_defined('HAVE_HIDAPI'):
return return
# Host Library # Host Library