bazel-contrib / rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)
https://bazel-contrib.github.io/rules_foreign_cc
Apache License 2.0
680 stars 249 forks source link

Feature Request: How can I add a include path of a deps library in rule cmake? #1179

Open sunzhec2702 opened 9 months ago

sunzhec2702 commented 9 months ago

Dear all,

I need you experts' help to use the rule cmake in a specific way.

  1. The project to use rule cmake(), called XXXX, need a library called "libacl". But I cannot simply install the libacl by apt.
  2. I use cc_import() to create a library with shared_library and header files. I wrote a demo file to use the cc_import library which is OK to use. The <sys/acl.h> can be found.
  3. But if I simply add a argument "@libacl//:libacl" just like I used in the demo code in the XXXX project with cmake(). It didn't work.

From the cmake log, I can see that the libacl project was copied to the ext_build_deps folder. But after I enabled the verbose of cmake, the include path of the "libacl" was not passed to gcc.

"-I" parameter is only followed by the XXXX's include path.

How should I use rule cmake in this case?