【问题标题】:Boost build error of recursion in main target references提高主要目标引用中递归的构建错误
【发布时间】:2020-10-30 17:28:36
【问题描述】:

我想有条件地使用库(带有替代品)作为目标。我不想在任何地方添加诸如<usefoo>yes:<library>foo 之类的条件,但更喜欢创建传播功能。但是,b2 会为以下卡纸生成错误。

import feature ;

feature.feature usefoo : yes : propagated composite optional ;
feature.compose <usefoo>yes : <library>foo ;

lib foo : : : : <include>foo <define>USE_FOO ;
lib foo : : <toolset>gcc-10 : : <include>foo_gcc10 <define>USE_FOO ;

lib bar ;
# Undesirable because there may be lots of bars.
# lib bar : : <usefoo>yes:<library>foo ;

exe test1 : test.cc : <library>bar ;
exe test2 : test.cc : <usefoo>yes <library>bar ;
error: Recursion in main target references
error: the following target are being built currently:
error: ./test2 ./bar ./foo ./foo

我也不能将 foo 的要求放在 &lt;usefoo&gt;yes 中。 feature.compose 似乎不接受有条件的要求。这样做的正确方法是什么?

【问题讨论】:

    标签: c++ boost boost-build b2 jam


    【解决方案1】:

    feature.compose &lt;usefoo&gt;yes : &lt;library&gt;foo ; 将需求应用于所有内容,因此库 foo 将获得 &lt;library&gt;foo 需求,这会导致无法解决的依赖循环。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-05
      • 1970-01-01
      • 2016-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-26
      • 2014-11-30
      相关资源
      最近更新 更多