Made sure the entry point is not generated when -no-entry-point is specified.

This commit is contained in:
F0x1fy
2020-11-10 10:16:22 -07:00
parent 6b6f1a5283
commit 0eba4b46b5

View File

@@ -12646,7 +12646,7 @@ void ir_gen_tree(irGen *s) {
#if defined(GB_SYSTEM_WINDOWS)
if (build_context.build_mode == BuildMode_DynamicLibrary && !has_dll_main) {
if (build_context.build_mode == BuildMode_DynamicLibrary && !has_dll_main && !build_context.no_entry_point) {
// DllMain :: proc(inst: rawptr, reason: u32, reserved: rawptr) -> i32
String name = str_lit("DllMain");
Type *proc_params = alloc_type_tuple();
@@ -12717,7 +12717,7 @@ void ir_gen_tree(irGen *s) {
ir_emit_return(proc, v_one32);
}
#endif
if (!(build_context.build_mode == BuildMode_DynamicLibrary && !has_dll_main)) {
if (!(build_context.build_mode == BuildMode_DynamicLibrary && !has_dll_main) && !build_context.no_entry_point) {
// main :: proc(argc: i32, argv: ^^u8) -> i32
String name = str_lit("main");
@@ -12796,7 +12796,7 @@ void ir_gen_tree(irGen *s) {
}
#if defined(GB_SYSTEM_WINDOWS)
if (build_context.build_mode != BuildMode_DynamicLibrary && build_context.no_crt) {
if (build_context.build_mode != BuildMode_DynamicLibrary && build_context.no_crt && !build_context.no_entry_point) {
s->print_chkstk = true;
{