authorgravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-10-17 22:18:50+03:00
committergravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-10-20 15:21:32+03:00
loga983a0a59b348a885f24656a8646707554170574
treecbbe372a116dbdaee260a80b18bd190d97b01f49
parentd6cab0d4b653b1f6d7340b9a24766abae4f208a8

Add /usr/local/lib path for libxml2 and link libc++ on FreeBSD


2 files changed, 12 insertions(+), 1 deletions(-)

build.zig+5-1
......@@ -284,7 +284,7 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
284284 exe.addObjectFile(libstdcxx_path);
285285
286286 exe.linkSystemLibrary("pthread");
287 } else if (exe.target.isDarwin()) {
287 } else if (exe.target.isDarwin() or exe.target.isFreeBSD()) {
288288 exe.linkSystemLibrary("c++");
289289 }
290290
......@@ -293,6 +293,10 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
293293 }
294294
295295 if (exe.target.getOs() != builtin.Os.windows) {
296 if (exe.target.isFreeBSD()) {
297 exe.addLibPath("/usr/local/lib");
298 // TODO use pkg-config
299 }
296300 exe.linkSystemLibrary("xml2");
297301 }
298302 exe.linkSystemLibrary("c");
std/build.zig+7
......@@ -795,6 +795,13 @@ pub const Target = union(enum).{
795795 };
796796 }
797797
798 pub fn isFreeBSD(self: *const Target) bool {
799 return switch (self.getOs()) {
800 builtin.Os.freebsd => true,
801 else => false,
802 };
803 }
804
798805 pub fn wantSharedLibSymLinks(self: *const Target) bool {
799806 return !self.isWindows();
800807 }