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

Link MSVC runtime dynamically #9278

Closed
wants to merge 2 commits into from
Closed

Conversation

oprypin
Copy link
Member

@oprypin oprypin commented May 11, 2020

This is the best practice and also a better default, because the alternative contradicts the defaults when building any other library to link with (as evidenced by the simplification of the CI config).

But this will mean the built executables will have this DLL dependency.

This is the way recommended for most uses and also a better default because the alternative breaks defaults when building any other library to link with (as evidenced by the simplification of the CI config).

But this will mean the built executables will have this DLL dependency.
@@ -1,5 +1,5 @@
{% if flag?(:win32) %}
@[Link("libcmt")]
@[Link("msvcrt")]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there should be a -Dwin_MT to link libcmt for those that want to use /MT builds.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably. But not sure I like that exact name and approach to choosing this option.

But it is true that this is different from --static.
(Wait, does that one even apply to Windows? It's *.lib either way? And I think we've been linking statically without --static)

@oprypin
Copy link
Member Author

oprypin commented May 15, 2020

Egh you know what, it's quite a nice "side effect" that currently any executable built just from Crystal stdlib is fully self-contained. So I don't want to change the default anymore, maybe let's just make this overridable for people who need it. (still looking for ideas about a nice flag name or such).

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