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