Skip to content

Feature Request: Support explicit MinGW CRT selection (UCRT / MSVCRT) #7759

Description

@damster101

Is your feature request related to a problem? Please describe.

MinGW-w64 has two mutually ABI-incompatible C runtime environments on Windows:

  • MSVCRT, which classic gcc mingw defaults to
  • UCRT, the default for llvm-mingw

A user may wish to or need to target a specific runtime environment, but currently, xmake defaults to whatever the default of the auto-selected toolchain happens to be, with no standard way to explicitly declare/override the CRT.

Describe the solution you'd like

The default behavior (xmake f -p mingw) should be left unchanged (just let the compiler run its defaults), but explicit overrides should be possible. I see two different ways to express this:

  1. --platform / set_plat
xmake f -p "mingw[ucrt]"
xmake f -p "mingw[msvcrt]"
  1. --runtimes / set_runtimes
xmake f -p mingw --runtimes=ucrt
xmake f -p mingw --runtimes=msvcrt

Describe alternatives you've considered

No response

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions