Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DiaSDK for cross-compiling with mstorsjo/msvc-wine #14076

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vid512
Copy link
Contributor

@vid512 vid512 commented Jan 5, 2025

Adds support for dependency('diasdk') when cross-compiling for Windows with mstorsjo/msvc-wine environment (https://github.com/mstorsjo/msvc-wine).

As for testing: Works for me™, but no unit tests were added. If I understand things correctly, adding tests for this will require downloading and installing few GBs of Microsoft libraries with mstorsjo/msvc-wine scripts. I'm not sure if that is desired in Meson pipeline for such an obscure scenario. If yes, with a bit of help, I hope I can add it. See also:

@vid512 vid512 requested a review from jpakkane as a code owner January 5, 2025 22:41
# on linux for cross-compiling, only clang with explicit MS-compatibility
# parameters)
# We'll look for '<msvc>/kits/<number>/include/<kit version>/winrt'
# in INCLUDE.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does INCLUDE come from? It is an extremely general name so it is confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from script msvcenv-native.sh, which is part of mstorsjo/msvc-wine. The script is used in same way as vcvars*.bat in MSVC. You source it in your shell before building with clang-cl. The script exports INCLUDE and LIB environment variables, pointing to MSVC headers/libs. Environment variables are then consumed by clang-cl.

See: https://github.com/mstorsjo/msvc-wine?tab=readme-ov-file#use-with-clanglld-in-msvc-mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants