cross-only build with no native compiler installed? #11249
-
I'm working on a meson-based toolchain for developing Game Boy Advance games. The homebrew community has many less tech-savvy users, and "installing a native compiler" can actually be a fairly difficult step for many of them, particularly on Windows or Mac where Visual Studio and Xcode can be huge downloads (7 GB for MSVC and the Windows 10 SDK!) Does meson support a "cross-only" build if you specify a cross file and nothing in your code uses If it's not supported, would it be possible to have it be supported? It's a somewhat fringe use case, but there are many projects that only need a target compiler, and it could also speed up things like CI. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Listing a language in the In both cases, Meson will attempt to detect a build machine compiler (native) as well as a host machine compiler (cross) -- if the build is a native build, they're the same thing. If the host machine compiler isn't found (the cross one in a cross build, the only one in a native build) then the value of "required" determines whether to error out (defaults to true). If the build machine (native) in a cross build is not found, it's ignored regardless of the required kwarg. tl;dr -- this should work out of the box. |
Beta Was this translation helpful? Give feedback.
Listing a language in the
project()
function is similar to invoking theadd_languages()
function withrequired: true
.In both cases, Meson will attempt to detect a build machine compiler (native) as well as a host machine compiler (cross) -- if the build is a native build, they're the same thing.
If the host machine compiler isn't found (the cross one in a cross build, the only one in a native build) then the value of "required" determines whether to error out (defaults to true). If the build machine (native) in a cross build is not found, it's ignored regardless of the required kwarg.
tl;dr -- this should work out of the box.