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

CRT linking option of Triplet not considered by CMake Toolchain #2966

Closed
Squareys opened this issue Mar 5, 2018 · 5 comments
Closed

CRT linking option of Triplet not considered by CMake Toolchain #2966

Squareys opened this issue Mar 5, 2018 · 5 comments

Comments

@Squareys
Copy link
Contributor

Squareys commented Mar 5, 2018

Hi everybody, Hi @ras0219-msft !

When installing packages with the x64-windows-static triplet, the CRT ist linked statically. When compiling with the CMake toolchain (scripts/buildsystems/vcpkg.cmake), and VCPKG_TARGET_TRIPLET=x64-windows-static, the CRT is dynamically linked.

Effectively this makes compilation a little difficult, as then a mismatch of runtimes is detected and compilation fails.

While some libraries (like sdl2) provide an configuration option to force runtime linkage to static or dynamic, I believe for libraries should generally not require notion of CRT linking types in such a way. The toolchain should instead correctly set CMAKE_C(XX)_FLAGS as with installation.

Please let me know what you think. I would be great if someone could handle this (as I won't be able to get around to doing so myself in the near future.)

Cheers, Jonathan

@Squareys
Copy link
Contributor Author

@ras0219-msft Any comments? :)

@Squareys
Copy link
Contributor Author

@ras0219-msft I may have a bit of time to look at this (it doesn't look like a complex task to me). In case you agree that it should behave as described.

@Squareys
Copy link
Contributor Author

Squareys commented Mar 12, 2018

I just noticed that alot of the toolchain handling etc has changed in the past couple of days. As far as I understand, with the new scripts/toolchains/windows.cmake, this should all work fine! 🎉 it would be fine, if scripts/buildsystems/vcpkg.cmake would be using it (?)

@Squareys
Copy link
Contributor Author

@ras0219-msft Sorry for being so obtrusive, but it would be really great to know what to do about this.

As mentioned, I would even have time to do another PR, in case you see the need for something being changed.

@Squareys
Copy link
Contributor Author

Squareys commented Aug 9, 2018

There is the VCPKG_CRT_LINKAGE environment variable, see documentation

@Squareys Squareys closed this as completed Aug 9, 2018
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

No branches or pull requests

1 participant