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

Add support for static MSVC CRT on Windows #68

Merged
merged 2 commits into from Jan 10, 2020

Conversation

repi
Copy link
Contributor

@repi repi commented Dec 20, 2019

We wanted to use shaderc with full static linking of the MSVC CRT on Windows, so added detection in build.rs if crt-static is used and if so enable it instead of the default dynamic static linking.

This works both for enabling the static C runtime in a program with .cargo/config like this:

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

And enabling it on the command-line with the RUSTFLAGS env var (which cargo picks up):

RUSTFLAGS='-C target-feature=+crt-static' cargo test

Copy link
Collaborator

@antiagainst antiagainst left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@antiagainst antiagainst merged commit 14a19c0 into google:master Jan 10, 2020
@repi repi mentioned this pull request Feb 25, 2020
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.

None yet

2 participants