devenv: add support for compiling to msvc targets with llvm/clang
This commit is contained in:
@@ -14,3 +14,7 @@ workspaces/**
|
||||
|
||||
# wine
|
||||
wineprefix
|
||||
|
||||
# msvc
|
||||
xwin
|
||||
.xwin-cache
|
||||
|
||||
+21
-3
@@ -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
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user