6

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

我在现有代码中使用以下包含:

#include "gtest/gtest.h"
#include "fw/core/uncopyable_mixin.h"

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

#include "google/gtest/include/gtest/gtest.h"
#include "florianwolters/include/fw/core/uncopyable_mixin.h"

如果我更换包含,一切都按预期工作。但正如我已经说过的,我不想要这样丑陋的包含路径,而是使用常识(就像 Boost 和其他库一样)。

因此我确实需要映射路径。我已经阅读biicode.conf并偶然发现了该[includes]部分。

我尝试了以下方法:

[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]

但这不起作用:

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语句一起使用?这必须有效,否则它是一个杀手标准......

4

1 回答 1

5

[includes] 部分将右侧部分添加到左侧,以防左侧模式与文件名匹配。在您的情况下,最后一个文件夹不是必需的。请尝试:

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

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

[includes]
    gtest/*.h: google/gtest/include
    fw/core/*.h: florianwolters/uncopyable-mixin/include
于 2014-12-31T16:51:40.797 回答