authorgravatar for 3811822-hoanga@users.noreply.gitlab.comAl Hoang <3811822-hoanga@users.noreply.gitlab.com> 2021-04-23 23:37:35-05:00
committergravatar for 3811822-hoanga@users.noreply.gitlab.comAl Hoang <3811822-hoanga@users.noreply.gitlab.com> 2021-04-23 23:37:35-05:00
log7a78b92fa0283501664a6f25bc68471dea04fab5
treedd57174b721efa428eecfe214274b354762c20e5
parenta279f18bce488460f87f41545411fc964dcaa4b0

header path detection for haiku


1 files changed, 9 insertions(+), 2 deletions(-)

src/libc_installation.zig+9-2
...@@ -9,6 +9,7 @@ const build_options = @import("build_options");...@@ -9,6 +9,7 @@ const build_options = @import("build_options");
9const is_darwin = Target.current.isDarwin();9const is_darwin = Target.current.isDarwin();
10const is_windows = Target.current.os.tag == .windows;10const is_windows = Target.current.os.tag == .windows;
11const is_gnu = Target.current.isGnu();11const is_gnu = Target.current.isGnu();
12const is_haiku = Target.current.os.tag == .haiku;
1213
13const log = std.log.scoped(.libc_installation);14const log = std.log.scoped(.libc_installation);
1415
...@@ -279,8 +280,14 @@ pub const LibCInstallation = struct {...@@ -279,8 +280,14 @@ pub const LibCInstallation = struct {
279 return error.CCompilerCannotFindHeaders;280 return error.CCompilerCannotFindHeaders;
280 }281 }
281282
282 const include_dir_example_file = "stdlib.h";283 const include_dir_example_file = if (is_haiku) "posix/stdlib.h" else "stdlib.h";
283 const sys_include_dir_example_file = if (is_windows) "sys\\types.h" else "sys/errno.h";284 const sys_include_dir_example_file = if (is_windows)
285 "sys\\types.h"
286 else if (is_haiku)
287 "posix/errno.h"
288 else
289 "sys/errno.h"
290 ;
284291
285 var path_i: usize = 0;292 var path_i: usize = 0;
286 while (path_i < search_paths.items.len) : (path_i += 1) {293 while (path_i < search_paths.items.len) : (path_i += 1) {