Skip to content

Commit

Permalink
selfhost: Don't assume that the basename of the compiler is 'foo++'
Browse files Browse the repository at this point in the history
Now invocations such as `g++-<version>`, `x86_64-pc-serenity-g++`, and
more will all get the g++ flags added, instead of spewing warinings
about string literals all over the console.

This also means that cross-compiling with x86_64-pc-serenity-clang++
will actually apply target flags.
  • Loading branch information
ADKaster committed Mar 18, 2024
1 parent 435baff commit def4bf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion selfhost/main.jakt
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ fn compiler_main(anon args: [String]) throws -> c_int {
}

let compiler_is = fn[cxx_compiler_path](anon name: String) throws -> bool {
return Path::from_string(cxx_compiler_path).basename() == name
return Path::from_string(cxx_compiler_path).basename().contains(name)
}

mut file_name: String? = None
Expand Down
2 changes: 1 addition & 1 deletion selfhost/platform/posix_compiler.jakt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn run_compiler(
mut file_path = Path::from_string(cxx_compiler_path)

mut extra_flags: [String] = []
if file_path.basename() == "g++" {
if file_path.basename().contains("g++") {
extra_flags.push("-Wno-literal-suffix")
extra_flags.push("-Wno-unused-parameter")
extra_flags.push("-Wno-unused-but-set-variable")
Expand Down

0 comments on commit def4bf4

Please sign in to comment.