Biicode中的#include语句映射(biicode.conf)

Flo*_*ers 6 c++ dependencies include dependency-management biicode

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

我在现有代码中使用以下内容:

#include "gtest/gtest.h"
#include "fw/core/uncopyable_mixin.h"
Run Code Online (Sandbox Code Playgroud)

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

#include "google/gtest/include/gtest/gtest.h"
#include "florianwolters/include/fw/core/uncopyable_mixin.h"
Run Code Online (Sandbox Code Playgroud)

如果我更换包含,一切都按预期工作.但正如我已经说过的那样,我不想要这样丑陋的包含路径,而是使用常识(如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]
Run Code Online (Sandbox Code Playgroud)

但这不起作用:

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"
Run Code Online (Sandbox Code Playgroud)

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

dro*_*dri 5

如果左侧图案与文件名匹配,[includes]部分会将右侧部分添加到左侧.在您的情况下,不需要最后的文件夹.尝试改为:

[includes]
    gtest/gtest.h: google/gtest/include
    fw/core/uncopyable_mixin.h: florianwolters/uncopyable-mixin/include
Run Code Online (Sandbox Code Playgroud)

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

[includes]
    gtest/*.h: google/gtest/include
    fw/core/*.h: florianwolters/uncopyable-mixin/include
Run Code Online (Sandbox Code Playgroud)