Explorar el Código

Fix SUBSYSTEM for link.exe

Ginger Bill hace 8 años
padre
commit
1356dfeec2
Se han modificado 3 ficheros con 3 adiciones y 2 borrados
  1. 1 1
      src/ir.c
  2. 1 0
      src/ir_print.c
  3. 1 1
      src/main.c

+ 1 - 1
src/ir.c

@@ -5343,7 +5343,7 @@ void ir_gen_tree(irGen *s) {
 		ir_end_procedure_body(proc);
 	}
 #endif
-#if defined(GB_SYSTEM_WINDOWS)
+#if 0 && defined(GB_SYSTEM_WINDOWS)
 	if (!m->build_context->is_dll && !has_win_main) {
 		// WinMain :: proc(inst, prev: rawptr, cmd_line: ^byte, cmd_show: i32) -> i32
 		String name = str_lit("WinMain");

+ 1 - 0
src/ir_print.c

@@ -565,6 +565,7 @@ bool ir_print_is_proc_global(irModule *m, irProcedure *proc) {
 	if (proc->entity != NULL &&
 	    proc->entity->kind == Entity_Procedure) {
 		if (m->entry_point_entity == proc->entity) {
+			// gb_printf("%.*s\n", LIT(proc->entity->token.string));
 			// TODO(bill): This may not be needed during windows
 			return true;
 		}

+ 1 - 1
src/main.c

@@ -254,7 +254,7 @@ int main(int argc, char **argv) {
 	exit_code = win32_exec_command_line_app("msvc-link", true,
 		"link %.*s.obj -OUT:%.*s.%s %s "
 		"/defaultlib:libcmt "
-		"/nologo /incremental:no /opt:ref /subsystem:WINDOWS "
+		"/nologo /incremental:no /opt:ref /subsystem:CONSOLE "
 		" %.*s "
 		" %s "
 		"",