| ... | @@ -56,10 +56,17 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths { | ... | @@ -56,10 +56,17 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths { |
| 56 | break; | 56 | break; |
| 57 | }; | 57 | }; |
| 58 | try self.addRPath(rpath); | 58 | try self.addRPath(rpath); |
| 59 | } else if (word.len > 2 and word[0] == '-' and word[1] == 'L') { | 59 | } else if (mem.eql(u8, word, "-L") or mem.eql(u8, word, "-l")) { |
| | 60 | _ = it.next() orelse { |
| | 61 | try self.addWarning("Expected argument after -L or -l in NIX_LDFLAGS"); |
| | 62 | break; |
| | 63 | }; |
| | 64 | } else if (mem.startsWith(u8, word, "-L")) { |
| 60 | const lib_path = word[2..]; | 65 | const lib_path = word[2..]; |
| 61 | try self.addLibDir(lib_path); | 66 | try self.addLibDir(lib_path); |
| 62 | try self.addRPath(lib_path); | 67 | try self.addRPath(lib_path); |
| | 68 | } else if (mem.startsWith(u8, word, "-l")) { |
| | 69 | // Ignore this argument. |
| 63 | } else { | 70 | } else { |
| 64 | try self.addWarningFmt("Unrecognized C flag from NIX_LDFLAGS: {s}", .{word}); | 71 | try self.addWarningFmt("Unrecognized C flag from NIX_LDFLAGS: {s}", .{word}); |
| 65 | break; | 72 | break; |