error when building exe with no entry point

closes #30
This commit is contained in:
Andrew Kelley
2017-04-18 13:57:57 -04:00
parent 6f0f8a92ec
commit 237dfdbdc6
5 changed files with 58 additions and 3 deletions

View File

@@ -4726,7 +4726,9 @@ void codegen_add_root_code(CodeGen *g, Buf *src_dir, Buf *src_basename, Buf *sou
assert(g->root_out_name);
assert(g->out_type != OutTypeUnknown);
if (!g->is_test_build && g->have_pub_main && (g->out_type == OutTypeObj || g->out_type == OutTypeExe)) {
if (!g->is_test_build && g->zig_target.os != ZigLLVM_UnknownOS && !g->have_c_main &&
((g->have_pub_main && g->out_type == OutTypeObj) || g->out_type == OutTypeExe))
{
g->bootstrap_import = add_special_code(g, create_bootstrap_pkg(g), "bootstrap.zig");
}
if (!g->omit_zigrt) {