I am new to bazel, but I want to release a library to other with headers and shared library.
My code tree likes this(but more subdirectories) :
root
- feature1
- feature1.hpp
- feature1.cpp
- BUILD
- feature2
- feature2.hpp
- feature2.cpp
- BUILD
- feature3
- feature3.hpp
- feature3.cpp
- BUILD
- BUILD
I want to package a tar.gz file in the root BUILD with lib and include,
cc_binary(
name = "feature_impl",
deps = [
":feature1",
":feature2",
":feature3",
],
)
cc_binary(
name = "feature",
linkshared = True,
deps = [":feature_impl"],
)
filegroup(
name = "headers"
srcs = XXXXXXX
)
pkg_tar(
name = "headers_pkg"
srcs = "headers",
package_dir = "include",
)
pkg_tar(
name = "feature_pkg"
srcs = ":feature",
package_dir = "lib"
)
How can I package all the headers with sub directores structures ??
Now I have to write a pkg_tar target in the BUILD of every subdirectory.
Is there a rule like "sub_glob" for filegrouop?
New contributor
Darren Sun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.