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
Generate MSCV solution with static CRT? #776
Comments
A cursory search seems to suggest it's something you must configure manually, but I haven't checked our cmake setup to see if it was implemented previously. Jeremy Sent from my phone
|
Configured in Visual Studio after CMake generation, or can I configure CMake to generate the solution up front? |
Hi Thomas, I'd recommend you configure this in cmake and not modify the generated projects: https://cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F |
+1 and if you get it working via CMake, please send a pull request! Jeremy Sent from my phone
|
Oh, it looks like the doc George sent is explains how to setup a one-off CMake override, which is probably not something we would distribute. But if you get it working for real with a config option, then a pull request would be great. Jeremy Sent from my phone
|
Will do! |
I vaguely remember early releases of OSD having the /Mt option, but it looks like it's disappeared. This should be as easy as inserting /Mt here: Although : why not link statically both OSD and CRT with your shipping binary ? |
That's what I'm trying to do - but then I need to build the OSD libs with Thanks for the hint at where to change the |
That would change it permanently to be static CRT, right? Wouldn't it be desired to have this be configurable when running cmake? |
I had a quick look into this - and that's not as simple as just adding |
Don't have CMake + Visual Studio in front of me to verify the following but something like this is how I would construct them IF (WIN32) |
Correct me if I'm wrong, but it appear to me that that would not work for multi-configuration solutions. I got an alternative which works with multi-config solution:
When I added that to If that sounds good to you guys I'll make a pull request. Or if this isn't satisfactory then let me know and I'll dig further. |
Hm... I didn't actually try to build a Release with Found similar errors described here indicating there might be a mix of Not exactly sure what is going on. (It's late and I'll resume tomorrow.) |
Ok, so catching up here, did you previously add that lib by hand? Does it Or did CMake add that lib and you had to remove it by hand from the CMake Jeremy On Sun, Feb 7, 2016 at 5:07 PM, Thomas Thomassen notifications@github.com
|
I found that changing the solution after it was generated was too cumbersome because there are too many projects and configurations that all have to be updated. And it'd have to be done every time I want to update OSD. Now I just need to a pass in My main concern with the current state of this patch is the |
Making another attempt to bump. Don't expect anything for 3.1 which looks done. But hoping to be able to include something in next release to ease maintainability with This is what I currently use: thomthom@baa04da but in #783 there was some questions about perhaps have it as build configs in the solutions. But I'm not sure there was a definitive conclusion to what was desired? |
Any thoughts on this issue? |
Yes! Hoping to have a fix for you this week. We've been working through other Windows build issues including #905 and related static/dynamic dependencies... |
The simplification is that it's one flag for both Release and Debug? |
Right, just the single flag, and also making the "/NODEFAULTLIB:libcmt.lib" code mutually exclusive to avoid having to comment it out. |
Yea, I never understood where that libcmt.lib error came from. Thanks for tackling that as well. |
Fixed by #917 Thanks! |
Is it possible to have CMake generate a MSVC solution that uses static CRT? (/MT)
I'm admittedly not that familiar with CMake and I'm not sure if this is something that is generic to using CMake or if the project has to build in support for it.
My use case is that I'm writing an extension for an application where I'm implementing OpenSubdiv. The extensions for this application normally doesn't use installers but instead are packaged as simple ZIP packages that is unpacked. Hence I'm trying to avoid the need to depend on CRT.
The text was updated successfully, but these errors were encountered: