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

Consider adding `toolchains` parameter to `configure_make_variant` #1217

Open LeifAndersen opened 5 months ago

LeifAndersen commented 5 months ago

I'm trying to use rules_foreign_cc to build qemu. And at the moment, I'd like to use the preinstalled pkgconfig and preinstalled meson toolchains.

Unfortunately, it seems like configure_make_variant only allows for me to pass in a single toolchain, so I can't do something like:

configure_make_variant(
    name = "qemu",
    lib_source = "@qemu_dist//:all_srcs",
    toolchains = ["@rules_foreign_cc//toolchains:preinstalled_meson_toolchain",
                  "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain"]
)

Alternatively, if there was a way to compose toolchains, the existing toolchain parameter might work:

configure_make_variant(
    name = "qemu",
    lib_source = "@qemu_dist//:all_srcs",
    toolchain = compose_toolchains(["@rules_foreign_cc//toolchains:preinstalled_meson_toolchain",
                              "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain"])
)