| ... | @@ -693,6 +693,8 @@ const PkgConfigResult = struct { | ... | @@ -693,6 +693,8 @@ const PkgConfigResult = struct { |
| 693 | /// Run pkg-config for the given library name and parse the output, returning the arguments | 693 | /// Run pkg-config for the given library name and parse the output, returning the arguments |
| 694 | /// that should be passed to zig to link the given library. | 694 | /// that should be passed to zig to link the given library. |
| 695 | fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { | 695 | fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { |
| | 696 | const wl_rpath_prefix = "-Wl,-rpath,"; |
| | 697 | |
| 696 | const b = compile.step.owner; | 698 | const b = compile.step.owner; |
| 697 | const pkg_name = match: { | 699 | const pkg_name = match: { |
| 698 | // First we have to map the library name to pkg config name. Unfortunately, | 700 | // First we have to map the library name to pkg config name. Unfortunately, |
| ... | @@ -783,6 +785,8 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { | ... | @@ -783,6 +785,8 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { |
| 783 | try zig_cflags.appendSlice(&[_][]const u8{ "-D", macro }); | 785 | try zig_cflags.appendSlice(&[_][]const u8{ "-D", macro }); |
| 784 | } else if (mem.startsWith(u8, arg, "-D")) { | 786 | } else if (mem.startsWith(u8, arg, "-D")) { |
| 785 | try zig_cflags.append(arg); | 787 | try zig_cflags.append(arg); |
| | 788 | } else if (mem.startsWith(u8, arg, wl_rpath_prefix)) { |
| | 789 | try zig_cflags.appendSlice(&[_][]const u8{ "-rpath", arg[wl_rpath_prefix.len..] }); |
| 786 | } else if (b.debug_pkg_config) { | 790 | } else if (b.debug_pkg_config) { |
| 787 | return compile.step.fail("unknown pkg-config flag '{s}'", .{arg}); | 791 | return compile.step.fail("unknown pkg-config flag '{s}'", .{arg}); |
| 788 | } | 792 | } |