Skip to content

Commit

Permalink
feat: add commonly used go compilers to default compiler logic (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
schuylermartin45 authored Jun 19, 2024
1 parent 42787b2 commit 53a4392
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions src/recipe/jinja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,29 +188,33 @@ fn jinja_pin_function(
}

fn default_compiler(platform: Platform, language: &str) -> Option<String> {
if platform.is_windows() {
match language {
"c" => Some("vs2017"),
"cxx" => Some("vs2017"),
"fortran" => Some("gfortran"),
"rust" => Some("rust"),
_ => None,
}
} else if platform.is_osx() {
match language {
"c" => Some("clang"),
"cxx" => Some("clangxx"),
"fortran" => Some("gfortran"),
"rust" => Some("rust"),
_ => None,
}
} else {
match language {
"c" => Some("gcc"),
"cxx" => Some("gxx"),
"fortran" => Some("gfortran"),
"rust" => Some("rust"),
_ => None,
match language {
// Platform agnostic compilers
"fortran" => Some("gfortran"),
"rust" => Some("rust"),
"go" => Some("go"),
"go-nocgo" => Some("go-nocgo"),
// Platform specific compilers
_ => {
if platform.is_windows() {
match language {
"c" => Some("vs2017"),
"cxx" => Some("vs2017"),
_ => None,
}
} else if platform.is_osx() {
match language {
"c" => Some("clang"),
"cxx" => Some("clangxx"),
_ => None,
}
} else {
match language {
"c" => Some("gcc"),
"cxx" => Some("gxx"),
_ => None,
}
}
}
}
.map(|s| s.to_string())
Expand Down

0 comments on commit 53a4392

Please sign in to comment.