From 4af7c6bdee715c9a2f317b99b7f7c6e80abae1e7 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Thu, 31 Jul 2025 11:23:13 -0400 Subject: [PATCH] lib.systems: Add examples & helpers for MSVC --- lib/systems/default.nix | 2 ++ lib/systems/examples.nix | 11 +++++++++++ lib/systems/inspect.nix | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index edb69cc43194..60fa5832efa9 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -120,6 +120,8 @@ let libc = if final.isDarwin then "libSystem" + else if final.isMsvc then + "ucrt" else if final.isMinGW then "msvcrt" else if final.isWasi then diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 152ac4ddc0ec..a3ac648dee18 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -372,6 +372,17 @@ rec { useLLVM = true; }; + # Target the MSVC ABI + x86_64-windows = { + config = "x86_64-pc-windows-msvc"; + useLLVM = true; + }; + + aarch64-windows = { + config = "aarch64-pc-windows-msvc"; + useLLVM = true; + }; + # BSDs aarch64-freebsd = { diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 2cc009133f2a..65fdb9ee1959 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -344,6 +344,10 @@ rec { kernel = kernels.windows; abi = abis.gnu; }; + isMsvc = { + kernel = kernels.windows; + abi = abis.msvc; + }; isWasi = { kernel = kernels.wasi; };