| ... | ... | @@ -135,6 +135,32 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths |
| 135 | 135 | // zlib.h is in /usr/include (added above) |
| 136 | 136 | // libz.so.1 is in /lib/x86_64-linux-gnu (added here) |
| 137 | 137 | try self.addLibDirFmt("/lib/{s}", .{triple}); |
| 138 | |
| 139 | // NOTE: distro like guix doesn't use FHS, so it relies on envorinment |
| 140 | // variables (C_INCLUDE_PATH, CPLUS_INCLUDE_PATH and LIBRARY_PATH) to |
| 141 | // search for headers and libraries |
| 142 | // NOTE: we use os.getenv here since this part won't be executed on |
| 143 | // windows, to get rid of unnecessary error handling |
| 144 | if (std.os.getenv("C_INCLUDE_PATH")) |c_include_path| { |
| 145 | var it = mem.tokenize(u8, c_include_path, ":"); |
| 146 | while (it.next()) |dir| { |
| 147 | try self.addIncludeDir(dir); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | if (std.os.getenv("CPLUS_INCLUDE_PATH")) |cplus_include_path| { |
| 152 | var it = mem.tokenize(u8, cplus_include_path, ":"); |
| 153 | while (it.next()) |dir| { |
| 154 | try self.addIncludeDir(dir); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | if (std.os.getenv("LIBRARY_PATH")) |library_path| { |
| 159 | var it = mem.tokenize(u8, library_path, ":"); |
| 160 | while (it.next()) |dir| { |
| 161 | try self.addLibDir(dir); |
| 162 | } |
| 163 | } |
| 138 | 164 | } |
| 139 | 165 | |
| 140 | 166 | return self; |