[Question] Can I do cross compiling, and how? #2651
-
OverviewCan I generate linux or macos executable on windows? If I can, how? If I can't, will this be supported in the future? ReferenceI saw this on Link to C3 web "output": "../build",
// Architecture and OS target.
// You can use 'c3c --list-targets' to list all valid targets,
// "target": "windows-x64",
// Current Target options:
// android-aarch64
// elf-aarch64 elf-riscv32 elf-riscv64 elf-x86 elf-x64 elf-xtensa
// mcu-x86 mingw-x64 netbsd-x86 netbsd-x64 openbsd-x86 openbsd-x64
// freebsd-x86 freebsd-x64 ios-aarch64
// linux-aarch64 linux-riscv32 linux-riscv64 linux-x86 linux-x64
// macos-aarch64 macos-x64
// wasm32 wasm64
// windows-aarch64 windows-x64
"targets": {
"linux-x64": {
// Executable or library.
"type": "executable",
// Additional libraries, sources
// and overrides of global settings here.
},
},However, I can't build project as linux executable on windows, I'm a little confused. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
That page is a bit misleading, targets in the project.json can have any name and it doesn't affect what platform it compiles to. |
Beta Was this translation helpful? Give feedback.
-
|
I fixed that page now. |
Beta Was this translation helpful? Give feedback.

That page is a bit misleading, targets in the project.json can have any name and it doesn't affect what platform it compiles to.
Setting
"target": "linux-x64"or compiling with--target linux-x64will compile it to linux. That said I also don't know if it's currently possible to cross-compile from linux to windows, but if previously building would create a windows exe then try the above.