У меня проблема с тем, что заголовочные файлы не найдены, даже если они объявлены.Мои правила генерируются, как указано в этом ответе , но при выполнении я получаю ошибки, из-за которых некоторые цели не могут найти заголовочные файлы, от которых они зависят.
This is my folder structure:
component1/... /.../module1/(containing .c and .h files)
/... /.../module2/(containing .c and .h files)
/BUILD.bazel
/SrcList.bzl
/macro.bzl
BUILD-файл выглядит следующим образом.
cc_library(
name = "module1",
visibility = ["//visibility:public"],
deps = [],
srcs = ["//components/module1:target/src/module1.c"],
linkstatic = True,
hdrs = ["//components/module1:target/src/module1_1.h", "//components/module1:target/src/module1_2.h", "//components/module1:target/src/module1_3.h"],
)
cc_library(
name = "module2",
visibility = ["//visibility:public"],
deps = [:module1],
srcs = ["//components/module2:target/src/module2.c"],
linkstatic = True,
hdrs = ["//components/module2:target/src/module2_1.h", "//components/module2:target/src/module2_2.h", "//components/module2:target/src/module2_3.h"],
)
Файлы Src используют структуру #include "foo.h".Модуль 2 зависит от модуля 1.Но если я запускаю правило сборки, то module2 не может найти заголовки module1.Как мне это исправить?