devenv: add support for compiling to msvc targets with llvm/clang

This commit is contained in:
2026-10-09 13:14:57 -04:00
parent 56b408ea84
commit 9e1b423720
2 changed files with 25 additions and 3 deletions
+21 -3
View File
@@ -29,6 +29,8 @@ in
pkg-config
tree
unzip
lld
xxd
];
languages = {
@@ -47,11 +49,27 @@ in
WINEPREFIX = "${config.env.DEVENV_ROOT}/wineprefix";
};
enterShell = ''
wineboot
scripts = {
"clang-msvc".exec = ''
clang-cl -v -fuse-ld=lld -target x86_64-pc-windows-msvc \
-vctoolsdir $DEVENV_ROOT/xwin/crt -winsdkdir $DEVENV_ROOT/xwin/sdk \
"$@" \
/link /subsystem:console
'';
};
if [[ ! -e ./workspaces ]]; then
enterShell = ''
if [[ ! -e ${config.env.DEVENV_ROOT}/wineprefix ]]; then
wineboot
fi
if [[ ! -e ${config.env.DEVENV_ROOT}/workspaces ]]; then
mkdir ./workspaces
fi
if [[ ! -e ${config.env.DEVENV_ROOT}/xwin ]]; then
cargo install xwin
xwin --accept-license splat --preserve-ms-arch-notation --output ./xwin
fi
'';
}