Add /usr/local/lib path for libxml2 and link libc++ on FreeBSD
parent
d6cab0d4b6
commit
a983a0a59b
|
@ -284,7 +284,7 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
|
|||
exe.addObjectFile(libstdcxx_path);
|
||||
|
||||
exe.linkSystemLibrary("pthread");
|
||||
} else if (exe.target.isDarwin()) {
|
||||
} else if (exe.target.isDarwin() or exe.target.isFreeBSD()) {
|
||||
exe.linkSystemLibrary("c++");
|
||||
}
|
||||
|
||||
|
@ -293,6 +293,10 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
|
|||
}
|
||||
|
||||
if (exe.target.getOs() != builtin.Os.windows) {
|
||||
if (exe.target.isFreeBSD()) {
|
||||
exe.addLibPath("/usr/local/lib");
|
||||
// TODO use pkg-config
|
||||
}
|
||||
exe.linkSystemLibrary("xml2");
|
||||
}
|
||||
exe.linkSystemLibrary("c");
|
||||
|
|
|
@ -795,6 +795,13 @@ pub const Target = union(enum).{
|
|||
};
|
||||
}
|
||||
|
||||
pub fn isFreeBSD(self: *const Target) bool {
|
||||
return switch (self.getOs()) {
|
||||
builtin.Os.freebsd => true,
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn wantSharedLibSymLinks(self: *const Target) bool {
|
||||
return !self.isWindows();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue