为什么bazel不从外部拿起我的标头?

时间:2019-02-02 08:45:25

标签: bazel

我做bazel build //MyPackage:MyTarget时遇到问题

fatal error: tls.h: No such file or directory
 #include <tls.h>

我尝试了一切:

#include <external/libressl/install/include/tls.h>
#include <libressl/install/include/tls.h>
#include <include/tls.h>
#include <tls.h>

巴泽勒查询告诉我,依赖是有那么它应该是罚款:

bazel query 'labels(hdrs, //MyPackage:MyTarget)'
@libressl//install:hdrs

另外,标题本身确实得到回升:

bazel query 'labels(hdrs, @libressl//install:hdrs)'
@libressl//install:include/tls.h

这是目标:

cc_library(
    name = "MyTarget",
    hdrs = [
        "@libressl//install:hdrs"
    ],
    srcs = [
        "test.cpp",
    ],
    deps = [
    "@libressl//install:libssl", 
    "@libressl//install:libtls",
    "@libressl//install:libcrypto"
    ],
    copts = [
    "-Iexternal/libressl/install/include"],
)

那么可能是什么问题?我可以清楚地看到我的外部文件夹,并且路径正确,然后将其复制粘贴。完整路径:my-workspace/bazel-my-workspace-isolated/external/libressl/install/include/tls.h

1 个答案:

答案 0 :(得分:0)

我不得不把"@libressl//install:hdrs" {成{1}}