Last active
November 4, 2023 15:10
-
-
Save kassane/2a181fa4dfe66dbd283f3ad7a941ca2b to your computer and use it in GitHub Desktop.
LDC2 cross-compiling using zig toolchain - D language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Based on: https://github.com/kassane/xwin-zig-test/ | |
# download and unpack WinSDK and MSCRT libs | |
# manifest 16 == VS2019 | |
# xwin --manifest-version 16 --accept-license splat --output $PWD/.xwin --include-debug-symbols --preserve-ms-arch-notation --include-debug-libs | |
# "$HOME/ldc-xcross/lib64" - need prebuilded libs | |
# curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.35.0/ldc2-1.35.0-windows-multilib.7z | |
# copy LDC_ROOT/libs only (x86 or x64) | |
# ldc2 -Oz source/app.d -mtriple=x86_64-windows-msvc -static -c | |
zig cc -fno-sanitize=all -target x86_64-windows-msvc \ | |
-isystem $HOME/ldc-xcross/hello/.xwin/crt/include \ | |
-isystem $HOME/ldc-xcross/hello/.xwin/sdk/include \ | |
-isystem $HOME/ldc-xcross/hello/.xwin/sdk/include/10.0.22000/cppwinrt \ | |
-isystem $HOME/ldc-xcross/hello/.xwin/sdk/include/10.0.22000/ucrt \ | |
-isystem $HOME/ldc-xcross/hello/.xwin/sdk/include/10.0.22000/um \ | |
-isystem $HOME/ldc-xcross/hello/.xwin/sdk/include/10.0.22000/shared \ | |
-L $HOME/ldc-xcross/hello/.xwin/crt/lib/x64 \ | |
-L $HOME/ldc-xcross/hello/.xwin/sdk/lib/ucrt/x64 \ | |
-L $HOME/ldc-xcross/hello/.xwin/sdk/lib/um/x64 \ | |
-L$HOME/ldc-xcross/lib64 \ | |
-lphobos2-ldc -ldruntime-ldc $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dumpbin