【问题标题】:Is it possible to force boost-build adding subproject's include-path into main project?是否可以强制 boost-build 将子项目的包含路径添加到主项目中?
【发布时间】:2014-03-04 14:12:08
【问题描述】:

我为一个子项目制作了 bjam 文件。这个子项目包含一些源代码和标题。 构建的结果是一个静态库。我想从另一个项目中使用这个子项目。有没有办法避免明确指定子项目标头的路径?

例如:

# Jamfile for sub-library
project sublib
     : requirements <include>../headers/include
     : source-location ../ ;

lib sublib : [ glob src/*.cpp ] : <link>static ;

我希望 boost-build 自动将上面的“../headers/include”添加到下一个 jam-file 中。但现在我需要明确指定它

# Jamfile for my root project
use-project /sublib  : path_to_sublib/sublib-folder ;

project rootproject
: requirements <include>root_project_headers/
               <include>path_to_sublib/headers/include/ # explicit declaration
               <library>//sublib
               <define>_VARIADIC_MAX=10
     : source-location ../../ ;

exe root-executable : [ glob src/*.cpp ] ;

有可能吗?这些果酱文件是从我原来的文件中简化而来的。这些文件对我有用。

附:我在文档中找到了 usage-requirements 属性,但我没有找到让它工作的方法。我尝试了所有我能想象到的变体。

【问题讨论】:

    标签: c++ boost bjam boost-build


    【解决方案1】:

    子项目 Jamfile

     lib subproj
        : subproj.cpp
        : <include>.
          <link>static
        :
        : <include>.
        ;
    

    Jamfile 项目

    exe proj
        : <source files>
          /subproj//subproj
        ;
    

    为我工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-28
      • 2020-05-23
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 2015-04-29
      • 1970-01-01
      • 2019-07-02
      相关资源
      最近更新 更多