bazel-contrib / bazel-contrib/rules_foreign_cc
Meson lacks support for cross compilation
- Dominant language
- Starlark
- Stars
- 737
- Forks
- 270
- PR merge metrics
- No merged PRs in 30d
Description
Meson support was merged in #986, but appears to not have support for cross compilation. I am concluding this from a use case where I am trying to cross compile using the Emscripten compiler. For this to work, a [cross file](https://mesonbuild.com/Cross-compilation.html) should be provided to `meson setup`, however there is no logic for passing cross file as can be seen here:
https://github.com/bazelbuild/rules_foreign_cc/blob/9d5727d5e51bf1be8423dff7996bdb4d847b47e6/foreign_cc/meson.bzl#L113-L119
I think this should be solved by generating a cross file for Meson mirroring what is done for the CMake toolchain file here:
https://github.com/bazelbuild/rules_foreign_cc/blob/9d5727d5e51bf1be8423dff7996bdb4d847b47e6/foreign_cc/private/cmake_script.bzl#L197-L230
What do you think @jheaff1, @jsharpe, and @edison-moreland?
Contributor guide
Research direction
Start in foreign_cc/meson.bzl at the Meson setup invocation, then compare it with foreign_cc/private/cmake_script.bzl and the referenced toolchain-file generation. Done means Meson receives a generated cross file during setup and supports the Emscripten cross-compilation use case.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100