Merge pull request #3888 from roc-lang/windows-cross-compilation

windows cross compilation
This commit is contained in:
Richard Feldman 2022-08-27 07:59:05 -04:00 committed by GitHub
commit 7e3a10906c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 64 additions and 31 deletions

View file

@ -1111,6 +1111,7 @@ pub enum Target {
System,
Linux32,
Linux64,
Windows64,
Wasm32,
}
@ -1128,6 +1129,7 @@ impl Target {
System => "system",
Linux32 => "linux32",
Linux64 => "linux64",
Windows64 => "windows64",
Wasm32 => "wasm32",
}
}
@ -1137,6 +1139,7 @@ impl Target {
Target::System.as_str(),
Target::Linux32.as_str(),
Target::Linux64.as_str(),
Target::Windows64.as_str(),
Target::Wasm32.as_str(),
];
@ -1159,6 +1162,13 @@ impl Target {
environment: Environment::Musl,
binary_format: BinaryFormat::Elf,
},
Windows64 => Triple {
architecture: Architecture::X86_64,
vendor: Vendor::Unknown,
operating_system: OperatingSystem::Windows,
environment: Environment::Gnu,
binary_format: BinaryFormat::Coff,
},
Wasm32 => Triple {
architecture: Architecture::Wasm32,
vendor: Vendor::Unknown,
@ -1190,6 +1200,7 @@ impl std::str::FromStr for Target {
"system" => Ok(Target::System),
"linux32" => Ok(Target::Linux32),
"linux64" => Ok(Target::Linux64),
"windows64" => Ok(Target::Windows64),
"wasm32" => Ok(Target::Wasm32),
_ => Err(format!("Roc does not know how to compile to {}", string)),
}