wscript: add LIBRARY_PATH for library detection

MinGW GCC seems to ignore LIBRARY_PATH which causes problem
when some libraries not using pkg-config were installed to
local directory
This commit is contained in:
kwkam 2017-01-28 18:31:28 +08:00 committed by wm4
parent ea40fa36ee
commit d41f25009d
2 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,8 @@ def check_iconv(ctx, dependency_identifier):
if ctx.env.DEST_OS == 'openbsd' or ctx.env.DEST_OS == 'freebsd':
args['cflags'] = '-I/usr/local/include'
args['linkflags'] = '-L/usr/local/lib'
elif ctx.env.DEST_OS == 'win32':
args['linkflags'] = " ".join(['-L' + x for x in ctx.env.LIBRARY_PATH])
checkfn = check_cc(**args)
return check_libs(libs, checkfn)(ctx, dependency_identifier)

View File

@ -989,6 +989,8 @@ def configure(ctx):
ctx.find_program(windres, var='WINDRES', mandatory=False)
ctx.find_program('perl', var='BIN_PERL', mandatory=False)
ctx.add_os_flags('LIBRARY_PATH')
ctx.load('compiler_c')
ctx.load('waf_customizations')
ctx.load('dependencies')