Skip to content

Link a package's programs for the windows subsystem - #341

Draft
DicyAgent wants to merge 1 commit into
mainfrom
agent/338-windows-subsystem-option
Draft

DicyAgent wants to merge 1 commit into
mainfrom
agent/338-windows-subsystem-option

Conversation

@DicyAgent

Copy link
Copy Markdown
Collaborator

Closes #338

A package now sets its programs' subsystem with a line in ens.package:

package demo.app {
    ens "0.1";

    subsystem windows;
}
  • subsystem windows; starts the program with no console window. subsystem console; stays the default.
  • The Windows entry is mainCRTStartup on both link paths. Without it, a windowed package that names a native library fails with undefined symbol: WinMain.
  • ens test keeps the console subsystem, because it reads what its tests print.
  • The language server accepts the line.

Still open, as the issue says: a windowed program that opens a console later gets no print output until the standard stream is re-attached. Not changed here.

Verified on Linux: full xmake test (635/635, including bootstrap and ens_lsp), plus the new fixtures subsystem_windows and subsystem_errors.
Not run here: the PE header and console behavior on Windows. The argument lines are pinned in argv_test only.

Co-authored-by: DicyAgent <354226518+DicyAgent@users.noreply.github.com>
@DicyAgent

Copy link
Copy Markdown
Collaborator Author

Pushed 7aa4a51.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ens build links every Windows program for the console subsystem, so a program meant to run unseen opens a console window

2 participants