Skip to content

Commit

Permalink
self-hosted build: print helpful message when libstdc++.a not found
Browse files Browse the repository at this point in the history
closes #843
  • Loading branch information
andrewrk committed Mar 20, 2018
1 parent 71b4ee9 commit cb744f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build.zig
Expand Up @@ -64,6 +64,14 @@ pub fn build(b: &Builder) !void {
if (exe.target.getOs() == builtin.Os.linux) {
const libstdcxx_path_padded = try b.exec([][]const u8{cxx_compiler, "-print-file-name=libstdc++.a"});
const libstdcxx_path = ??mem.split(libstdcxx_path_padded, "\r\n").next();
if (mem.eql(u8, libstdcxx_path, "libstdc++.a")) {
warn(
\\Unable to determine path to libstdc++.a
\\On Fedora, install libstdc++-static and try again.
\\
);
return error.RequiredLibraryNotFound;
}
exe.addObjectFile(libstdcxx_path);

exe.linkSystemLibrary("pthread");
Expand Down

0 comments on commit cb744f3

Please sign in to comment.