ITADN

Non-invasive using cc_library

#1553Closedliuliu 创建于 2025-07-24
L
liuliucommented
Hi, sorry late for the upgrade party. I am looking into migrate from previously using `tags="swift_module="` to the new `swift_interop_hint` but confused about whether there is a non-invasive way to do this (i.e. not introducing bazelbuild/rules_swift to the cc_library). The best I can do is to create a new `cc_library` that depends on the other `cc_library` from a different repo, and then do the `swift_interop_hint` dance. This works when compiling swift_binary target, but when compiling swift_test target, I encountered header cannot be found issue with the shim.h file's include cannot be found any more, example output like this: ``` bazel-out/k8-dbg/bin/nnc/C_ccv_modulemap/_/../../../../../../nnc/C_ccv/shim.h:1:10: error: 'ccv.h' file not found ``` Not sure if this is an expected behavior and the best way is to just add bazelbuild/rules_swift dependency to the parent cc_library? That would limit the interoperability of Swift port since each and every cc dependency has to be vendored.
关闭于 2025-07-24 2 条评论