Open froody opened 1 month ago
That workaround is probably fine for your use case, but it would break other rules: with_cfg uses a subdirectory to have the original target use the same basename as the transitioned target, which can play a role for e.g. shared library names.
Since rules should generally support subdirs in name
, the best solution would be to fix this in rules_foreign_cc. I will see whether I can send a PR.
As a direct workaround, try setting the lib_name
attribute explicitly.
I defined
cmake_opt, _cmake_opt_internal = with_cfg(cmake).set("compilation_mode", "opt").build()
and then declared a rule for proj like so:but that gives the following error:
If I apply this diff to with_cfg.bzl, then everything builds fine: