Scaling number of supported platforms. Cross compilation of the rust code with bazel. Part 5
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4XhAJQ-_oV_tccylbQnDjb9Q4sgxtkVzn0vYT8bW4y246GvAzxQYnERCFQA0VvBF0Xb_kUNvj8GpWngEBLOqQsLgtqUs6sjbvoBrbD8MreycaSxMjDvkFKESu0YmYWY3eaAwT_4Q0xOdqZtXdP28NIe6s5WcN4ZOSPmEl-J0W2JaSHOnuikqNoteEcPd8/w640-h195/Screenshot%202024-01-27%20at%2007.01.18.png)
This is the 5th part of Basel cross-compilation series. Previous posts: What? Do I really need to configure C++ compiler to compile rust? Compilation from macOS(Intel) to linux x86_64 finaly works. Cross compilation for ARM v7. Fetching toolchains at build time. All the build files in the previous steps looked pretty much the same, the only differences were: URLs exec architecture target architecture some compiler flags (like paths) Of cause we don't want to support a separate build file for every host and target combination. The way around it maybe to generate it from the template. The easiest way would be to use string formatting int the *.bzl file. So we create `toolchains/cpp_toolchains.bzl`, and store the BUILD file content in the variable there: BUILD_FILE_TEMPLATE = """ load("@bazel_tools//tools/cpp:unix_cc_toolchain_config.bzl", "cc_toolchain_config") load