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

Static CRT for MSVC (DON'T MERGE THIS) #783

Closed
wants to merge 4 commits into from

Conversation

thomthom
Copy link
Contributor

I don't intend this to be merged - but merely as a way to talk about the changes I had to do to solve issue #776. Got some questions - once resolved I'll create a new clean pull request.

Testing with this config:

cmake ^
  -G "Visual Studio 12 2013 Win64" ^
  -D NO_EXAMPLES=1 ^
  -D NO_TUTORIALS=1 ^
  -D NO_REGRESSION=1 ^
  -D NO_MAYA=1 ^
  -D NO_PTEX=1 ^
  -D NO_DOC=1 ^
  -D NO_OMP=1 ^
  -D NO_TBB=1 ^
  -D NO_CUDA=1 ^
  -D NO_OPENCL=1 ^
  -D NO_OPENGL=1 ^
  -D NO_DX=1 ^
  -D NO_CLEW=1 ^
  -D MSVC_STATIC_CRT_RELEASE=1 ^
  -D MSVC_STATIC_CRT_DEBUG=1 ^
  ..

"${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
#set(CMAKE_EXE_LINKER_FLAGS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is my biggest concern. I don't understand why I was getting libcpmt.lib linker errors only in Release. And why the cp version and not the c version which is actually excluded.

Linker error log: https://gist.github.com/thomthom/5f9a23263c6a05ec5c5d

I did not observe any linker warnings by removing this. But maybe that's because I tried with a minimal config.

Anyone got any ideas to what is going on here?

@meshula
Copy link
Member

meshula commented Feb 11, 2016

LOL, good point! Nothing worse than the tiny tweak that expands into a re-engineering effort :)

@thomthom
Copy link
Contributor Author

giphy

I don't mind doing some research into figuring it out. Good opportunity for me to learn Cmake better. But being able to do that separately would be good.

My main concern about this current PR is the libcmt.lib issues I had. I never saw the LIBCMT linker warnings that the comment mentioned - so I've been unable to verify if commenting out those lines causes a regression. If anyone has some insight into that I'd appreciate it.

@thomthom
Copy link
Contributor Author

Seeing how there seem to be activity on this repo these days, may I try to bump this? Static CRT would be really handy for me - a must in fact. I do get around it for the moment by building of my custom mod - but I need to reinstate this every time I sync up.

@davidgyu
Copy link
Member

Yes, I'll take a look...

@thomthom
Copy link
Contributor Author

thomthom commented Oct 15, 2016

Bumping this again. I wanted to update OSD, but I really need static CRT. I can get around this for now my modifying my local fork, but it'd be nice if there was an option for this.

This is currently what I do to CMakeLists.txt to build OSD for my project on Windows: thomthom@baa04da

@davidgyu
Copy link
Member

Cherry-picked and updated as part of PR #917

Thanks again for getting this started!

@davidgyu davidgyu closed this Jan 12, 2017
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

3 participants