| ... | @@ -39,7 +39,6 @@ pub fn run( | ... | @@ -39,7 +39,6 @@ pub fn run( |
| 39 | const pc = &maker.pkg_config; | 39 | const pc = &maker.pkg_config; |
| 40 | const graph = maker.graph; | 40 | const graph = maker.graph; |
| 41 | const arena = graph.arena; // TODO don't leak into process arena | 41 | const arena = graph.arena; // TODO don't leak into process arena |
| 42 | const wl_rpath_prefix = "-Wl,-rpath,"; | | |
| 43 | | 42 | |
| 44 | const pkg_name = match: { | 43 | const pkg_name = match: { |
| 45 | // First we have to map the library name to pkg config name. Unfortunately, | 44 | // First we have to map the library name to pkg config name. Unfortunately, |
| ... | @@ -123,8 +122,8 @@ pub fn run( | ... | @@ -123,8 +122,8 @@ pub fn run( |
| 123 | try zig_cflags.appendSlice(arena, &.{ "-D", macro }); | 122 | try zig_cflags.appendSlice(arena, &.{ "-D", macro }); |
| 124 | } else if (mem.startsWith(u8, arg, "-D")) { | 123 | } else if (mem.startsWith(u8, arg, "-D")) { |
| 125 | try zig_cflags.append(arena, arg); | 124 | try zig_cflags.append(arena, arg); |
| 126 | } else if (mem.startsWith(u8, arg, wl_rpath_prefix)) { | 125 | } else if (mem.cutPrefix(u8, arg, "-Wl,-rpath,")) |rest| { |
| 127 | try zig_cflags.appendSlice(arena, &.{ "-rpath", arg[wl_rpath_prefix.len..] }); | 126 | try zig_cflags.appendSlice(arena, &.{ "-rpath", rest }); |
| 128 | } else if (force or pc.debug) { | 127 | } else if (force or pc.debug) { |
| 129 | return step.fail(maker, "{s} package {s} unknown flag: {s}", .{ pkg_config_exe, lib_name, arg }); | 128 | return step.fail(maker, "{s} package {s} unknown flag: {s}", .{ pkg_config_exe, lib_name, arg }); |
| 130 | } | 129 | } |