是否可以使用相同的命令安装库的调试和发布变体?
我正在使用以下 Jamfile(在目录 /home/morpheus/base/CDef 中):
lib CDef : [ glob *.cpp ] : static ;
安装libCDef :CDEF : 锂离子电池 “/home/morpheus/base_install/lib” : 发布 ;
安装_libCDef_D :CDEF : 锂离子电池 “/home/morpheus/base_install/libdebug” : 调试 ;
我想知道是否可以将两条安装线更改为同时具有调试和发布指令的安装线。
另外,为了使用不同目录( /home/morpheus/FSLR )中不同 Jamfile 中的库,我使用以下 Jamfile 来构建 exe callFSLR :
lib CDef : : release CDef /home/morpheus/base_install/lib ; lib CDef : : 调试 CDef /home/morpheus/base_install/libdebug ;
exe callFSLR: call_FSLR.cpp CDef:: 调试版本;
安装安装bin : 调用FSLR :“/home/morpheus/base_install/bin”发布 ;
我相信使用“use-project”来引用 Jamfile /home/morpheus/base/CDef/Jamfile 中的 CDef 可能是明智的?
I am using the following Jamfile ( in directory /home/morpheus/base/CDef ) :
lib CDef : [ glob *.cpp ] : static ;
install libCDef
: CDef
: LIB
"/home/morpheus/base_install/lib"
: release
;
install _libCDef_D
: CDef
: LIB
"/home/morpheus/base_install/libdebug"
: debug
;
I was wondering if the two install lines can be changed to one which has both the debug and release directives.
Also to use the libraries in a different Jamfile in a different directory ( /home/morpheus/FSLR ) I am using the following Jamfile to build the exe callFSLR :
lib CDef : : release CDef /home/morpheus/base_install/lib ;
lib CDef : : debug CDef /home/morpheus/base_install/libdebug ;
exe callFSLR : call_FSLR.cpp CDef : : debug release ;
install install-bin
: callFSLR
: "/home/morpheus/base_install/bin" release
;
I believe using "use-project" to refer to CDef in the Jamfile /home/morpheus/base/CDef/Jamfile is probably adviseable ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(我认为您的 jam 规则中缺少一些内容,可能是由于格式原因。)
是的,您绝对可以使用相同的规则定义调试和生产目标,使用 条件要求。一个例子甚至是
安装
规则。我相信您最初的规则看起来像
您希望使
location
功能依赖于变体,如下所示:至于第二个问题,是的,
use-project
会帮助,尽管这不是必要的。您想要执行此操作../base/CDef//CDef
引用项目(目录)中定义的名为CDef
的目标../base/CDef
。这是指库规则,因此boost build将使用bin目录中库的版本,而不是安装规则创建的版本。 (如果您有动态库问题,这可能很重要。)此外,您不需要紧邻此规则上方的lib CDef
。为了避免
../base/CDef
的笨拙,您可以使用use-project
规则为项目进行新的定义。那么如果你重新组织目录结构,你只有一个地方可以改变它。如果您要使用此 Jamfile 中的一个目标,另一种可能性是使用别名规则。
(I think some stuff is missing from your jam rules, possibly due to formatting.)
Yes, you definitely can define both the debug and production targets with the same rule, using conditional requirements. An example is even the documentation of the
install
rule.I believe your original rules look like
You'll want to make the
location
feature dependendent on the variant, like so:As for the second question, yes,
use-project
would help, although it shouldn't be necessary. You want to do this../base/CDef//CDef
refers to the target namedCDef
defined in the project (directory)../base/CDef
. This refers to the library rule, so boost build will use the version of the library in the bin directory, not the version created by the install rule. (This might matter if you have dynamic library issues.) Also, you don't need thelib CDef
immediately above this rule.To avoid the clumsiness of the
../base/CDef
, you could use theuse-project
rule to make a new definition for the project. Then should you reorganize the directory structure, you only have one place to change it.Another possibility, if you are going to use the one target in this one Jamfile, is to use the alias rule.