Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 701

What's the easiest way to pack all the header files in Bazel with pkg_tar to release library?

$
0
0

I am new to Bazel, but I want to release a library to other with headers and shared library.

My code tree looks likes this (but with 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?


Viewing all articles
Browse latest Browse all 701

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>