Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect the windows um include directory #3343

Merged
merged 2 commits into from
Sep 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8921,13 +8921,29 @@ static void detect_libc(CodeGen *g) {
}
}
bool want_sys_dir = !buf_eql_buf(&g->libc->include_dir, &g->libc->sys_include_dir);
size_t dir_count = 1 + want_sys_dir;
g->libc_include_dir_len = dir_count;
size_t want_um_and_shared_dirs = (g->zig_target->os == OsWindows) ? 2 : 0;
size_t dir_count = 1 + want_sys_dir + want_um_and_shared_dirs;
g->libc_include_dir_len = 0;
g->libc_include_dir_list = allocate<Buf*>(dir_count);
g->libc_include_dir_list[0] = &g->libc->include_dir;

g->libc_include_dir_list[g->libc_include_dir_len] = &g->libc->include_dir;
g->libc_include_dir_len += 1;

if (want_sys_dir) {
g->libc_include_dir_list[1] = &g->libc->sys_include_dir;
g->libc_include_dir_list[g->libc_include_dir_len] = &g->libc->sys_include_dir;
g->libc_include_dir_len += 1;
}

if (want_um_and_shared_dirs != 0) {
g->libc_include_dir_list[g->libc_include_dir_len] = buf_sprintf("%s" OS_SEP ".." OS_SEP "um",
buf_ptr(&g->libc->include_dir));
g->libc_include_dir_len += 1;

g->libc_include_dir_list[g->libc_include_dir_len] = buf_sprintf("%s" OS_SEP ".." OS_SEP "shared",
buf_ptr(&g->libc->include_dir));
g->libc_include_dir_len += 1;
}
assert(g->libc_include_dir_len == dir_count);
} else if ((g->out_type == OutTypeExe || (g->out_type == OutTypeLib && g->is_dynamic)) &&
!target_os_is_darwin(g->zig_target->os))
{
Expand Down