首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >#在Biicode (biicode.conf)中包含语句映射

#在Biicode (biicode.conf)中包含语句映射
EN

Stack Overflow用户
提问于 2014-12-31 12:03:12
回答 1查看 194关注 0票数 6

我想为依赖关系管理器Biicode创建一个块。我不希望触及现有的源代码,所以我必须将包含路径从现有的Bii块映射到我的源代码中使用的路径。

我正在使用现有代码中包含的以下内容:

代码语言:javascript
复制
#include "gtest/gtest.h"
#include "fw/core/uncopyable_mixin.h"

对于默认设置,Bii需要以下路径:

代码语言:javascript
复制
#include "google/gtest/include/gtest/gtest.h"
#include "florianwolters/include/fw/core/uncopyable_mixin.h"

如果我替换了包含,一切都如期而至。但是,正如我已经说过的,我不希望这样丑陋的包含路径,而是使用常识(就像Boost和其他库一样)。

因此,我确实需要绘制路径图。我读过关于biicode.conf的文章,无意中发现了[includes]部分。

我试过以下几种方法:

代码语言:javascript
复制
[requirements]
    google/gtest: 9
    florianwolters/uncopyable-mixin: 0

[parent]
    florianwolters/singleton: -1

[paths]
    include

[dependencies]

[mains]

[hooks]

[includes]
    gtest/gtest.h: google/gtest/include/gtest
    fw/core/uncopyable_mixin.h: florianwolters/uncopyable-mixin/include/fw/core

[data]

但这是行不通的:

代码语言:javascript
复制
INFO: Processing changes...
WARN: Removing unused reference to "florianwolters/uncopyable-mixin: 0" from florianwolters/singleton "requirements"
WARN: Removing unused reference to "google/gtest: 9" from florianwolters/singleton "requirements"

因此,我的问题是:如何配置映射以使其与现有的#include-statements一起工作?这必须有效,否则它是一个杀手-标准.

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-31 16:51:40

包含部分将右侧置于左侧,以防左侧模式与文件名匹配。在您的情况下,最后的文件夹是不必要的。试一试:

代码语言:javascript
复制
[includes]
    gtest/gtest.h: google/gtest/include
    fw/core/uncopyable_mixin.h: florianwolters/uncopyable-mixin/include

此外,请记住,您也可以使用模式(ala ):

代码语言:javascript
复制
[includes]
    gtest/*.h: google/gtest/include
    fw/core/*.h: florianwolters/uncopyable-mixin/include
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27720874

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档