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

CMake GLEW handling on Windows is broken-ish #53

Closed
jcowles opened this issue Sep 14, 2016 · 3 comments
Closed

CMake GLEW handling on Windows is broken-ish #53

jcowles opened this issue Sep 14, 2016 · 3 comments

Comments

@jcowles
Copy link

jcowles commented Sep 14, 2016

On Windows, when statically linking against Glew, GLEW_STATIC must be defined, here is the relevant part of glew.h:

/*
 * GLEW_STATIC is defined for static library.
 * GLEW_BUILD  is defined for building the DLL library.
 */

#ifdef GLEW_STATIC
#  define GLEWAPI extern
#else
#  ifdef GLEW_BUILD
#    define GLEWAPI extern __declspec(dllexport)
#  else
#    define GLEWAPI extern __declspec(dllimport)
#  endif
#endif

So on Windows when using glew32.lib (or glew32d.lib, which OpenSubdiv/USD doesn't support!) -> no switch needed.

When using glew32s.lib (glew32sd.lib) -> -DGLEW_STATIC is required.

Also, OpenSubdiv should guard against glew leaking into the public headers/templates, which I think is what I ran into -- will file a separate bug.

@jcowles
Copy link
Author

jcowles commented Sep 14, 2016

I have a fix

@jtran56
Copy link

jtran56 commented Sep 15, 2016

Filed as internal issue #137371.

@sunyab
Copy link
Contributor

sunyab commented Jan 20, 2017

We think this issue should be fixed in OpenSubdiv 3.1.1 by this commit:
PixarAnimationStudios/OpenSubdiv#905

I'm going to close this (and the associated pull request) out for now, please reopen if this is still an issue. Thanks!

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

3 participants