<p dir="auto">It would be great if you could cross compile binaries for different platforms when using <code class="notranslate">deno compile</code>.</p>
<p dir="auto">Example: <code class="notranslate">deno compile --target x86_64-apple-darwin https://deno.land/std@0.79.0/http/file_server.ts</code> from Linux or Windows to create a macOS binary.</p>
<p dir="auto">This should be relatively trivial to implement. Instead of using the current binary as the base binary for the compilation, we would download the binary for the specified target (using the same code as <code class="notranslate">deno upgrade</code>), and then use that as a compilation base binary.</p>
<p dir="auto">Now that a basic <code class="notranslate">deno compile</code> subcommand has been merged into deno it might be interesting to consider implementing support for a <code class="notranslate">--target</code> flag so that one could compile to all supported platforms from all supported platforms. Because of the approach taken for embedding the code into the binary it would probably be pretty easy to implement, the only slight problem being getting the binaries for the other platforms but those could just be fetched from releases.</p>