使用Waf查找本地外部库 [英] Finding local external libraries with Waf

查看:118
本文介绍了使用Waf查找本地外部库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个wscript文件,能够链接存储在项目目录中的外部库,而不是安装到系统,但我不确定这样做的最佳方式。

I'm creating a wscript file capable of linking external libraries that are stored in the project directory, rather than installed to the system, but I am unsure of the best way of doing so.

目前,我正在做以下事情:

Currently, I'm doing something along the lines of the following:

cfg.env.INCLUDES_A = [os.path.normpath('external/include')]
cfg.env.LIBPATH_A  = [os.path.normpath('external/win32/A/lib/x64')]
cfg.env.LIB_A      = ['A']
cfg.env.append_unique('COPY_LIBS', os.path.normpath('external/win32/A/lib/x64/A.dll'))

在这种情况下,我链接到A.lib的本地副本,然后将A.dll标记为要复制到我的安装目录(一个本地'dist'dir)后面的代码。但是,我知道安装到你的系统中的库可以做更多的事情:

In this case, I link to the local copy of A.lib and then mark the A.dll to be copied to my install directory (a local 'dist' dir) later in the code. However, I know for libraries installed to your system you can do something more along the lines of:

cfg.check_cxx(uselib_store="GL", stlib="opengl32")

使用本地存储的外部库来做类似这样的事情的方法?可能有一些 check_cxx(libpath =external / blah,...)或某种类别?

My question then, I suppose, is: is there a way to do something similar to this with locally stored external libraries? Possibly some check_cxx(libpath="external/blah", ...) or something of the sort?

推荐答案

read_shlib read_stlib 您可以使用。

There is read_shlib and read_stlib that you can use.

您可以这样使用它:

bld.read_shlib('opengl32', paths='external/blah')

这篇关于使用Waf查找本地外部库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆