Skip to content

windows support needed to select subsystem for compilation #2986

Closed
@metajack

Description

@metajack

Currently rustc seems to default to the console subsystem on windows (both for gnu and msvc builds). There should be some way to set this in Cargo.toml so that the correct subsystem is used.

Here are the known ways to deal with this currently, all of which suck:

  1. After cargo builds a console subsystem app, if you want a windows subsystem one, run editbin.exe manually or as part of some higher level build script like mach.
  2. Override the linker with fake one that runs editbin.exe on the executable and swaps the subsystem. This solution won't work if your link command is not a real compiled executable because the link command line might be too long due to windows command line argument limitations.
  3. Set RUSTFLAGS="-C link-args=-Wl,--subsystem,windows" or whatever subsystem you want. Unfortunately this causes Cargo to link every executable with the windows subsystem. In particular this means all build scripts get compiled this way which means they pop up console windows constantly during the build process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions