| ... | ... | @@ -273,6 +273,7 @@ const usage_build_generic = |
| 273 | 273 | \\ --eh-frame-hdr Enable C++ exception handling by passing --eh-frame-hdr to linker |
| 274 | 274 | \\ -dynamic Force output to be dynamically linked |
| 275 | 275 | \\ -static Force output to be statically linked |
| 276 | \\ --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n" |
| 276 | 277 | \\ |
| 277 | 278 | \\Test Options: |
| 278 | 279 | \\ --test-filter [text] Skip tests that do not match filter |
| ... | ... | @@ -439,6 +440,7 @@ fn buildOutputType( |
| 439 | 440 | var override_lib_dir: ?[]const u8 = null; |
| 440 | 441 | var main_pkg_path: ?[]const u8 = null; |
| 441 | 442 | var clang_preprocessor_mode: Compilation.ClangPreprocessorMode = .no; |
| 443 | var subsystem: ?std.Target.SubSystem = null; |
| 442 | 444 | |
| 443 | 445 | var system_libs = std.ArrayList([]const u8).init(gpa); |
| 444 | 446 | defer system_libs.deinit(); |
| ... | ... | @@ -575,6 +577,39 @@ fn buildOutputType( |
| 575 | 577 | } else { |
| 576 | 578 | fatal("expected [auto|on|off] after --color, found '{}'", .{next_arg}); |
| 577 | 579 | } |
| 580 | } else if (mem.eql(u8, arg, "--subsystem")) { |
| 581 | if (i + 1 >= args.len) fatal("expected parameter after {}", .{arg}); |
| 582 | i += 1; |
| 583 | if (mem.eql(u8, args[i], "console")) { |
| 584 | subsystem = .Console; |
| 585 | } else if (mem.eql(u8, args[i], "windows")) { |
| 586 | subsystem = .Windows; |
| 587 | } else if (mem.eql(u8, args[i], "posix")) { |
| 588 | subsystem = .Posix; |
| 589 | } else if (mem.eql(u8, args[i], "native")) { |
| 590 | subsystem = .Native; |
| 591 | } else if (mem.eql(u8, args[i], "efi_application")) { |
| 592 | subsystem = .EfiApplication; |
| 593 | } else if (mem.eql(u8, args[i], "efi_boot_service_driver")) { |
| 594 | subsystem = .EfiBootServiceDriver; |
| 595 | } else if (mem.eql(u8, args[i], "efi_rom")) { |
| 596 | subsystem = .EfiRom; |
| 597 | } else if (mem.eql(u8, args[i], "efi_runtime_driver")) { |
| 598 | subsystem = .EfiRuntimeDriver; |
| 599 | } else { |
| 600 | fatal("invalid: --subsystem: '{s}'. Options are:\n{s}", .{ |
| 601 | args[i], |
| 602 | \\ console |
| 603 | \\ windows |
| 604 | \\ posix |
| 605 | \\ native |
| 606 | \\ efi_application |
| 607 | \\ efi_boot_service_driver |
| 608 | \\ efi_rom |
| 609 | \\ efi_runtime_driver |
| 610 | \\ |
| 611 | }); |
| 612 | } |
| 578 | 613 | } else if (mem.eql(u8, arg, "-O")) { |
| 579 | 614 | if (i + 1 >= args.len) fatal("expected parameter after {}", .{arg}); |
| 580 | 615 | i += 1; |
| ... | ... | @@ -1539,6 +1574,7 @@ fn buildOutputType( |
| 1539 | 1574 | .test_filter = test_filter, |
| 1540 | 1575 | .test_name_prefix = test_name_prefix, |
| 1541 | 1576 | .disable_lld_caching = !have_enable_cache, |
| 1577 | .subsystem = subsystem, |
| 1542 | 1578 | }) catch |err| { |
| 1543 | 1579 | fatal("unable to create compilation: {}", .{@errorName(err)}); |
| 1544 | 1580 | }; |