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

[osg] windows-static builds of dependent ports fail (e.g. osg-qt) #10249

Closed
Neumann-A opened this issue Feb 28, 2020 · 4 comments
Closed

[osg] windows-static builds of dependent ports fail (e.g. osg-qt) #10249

Neumann-A opened this issue Feb 28, 2020 · 4 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@Neumann-A
Copy link
Contributor

Reason: CMake dependent ports will always assume shared build on windows.
From include/osg/Export

#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__)  || defined( __MWERKS__)
    #  if defined( OSG_LIBRARY_STATIC )
    #    define OSG_EXPORT
    #  elif defined( OSG_LIBRARY )
    #    define OSG_EXPORT   __declspec(dllexport)
    #  else
    #    define OSG_EXPORT   __declspec(dllimport)
    #  endif
#else
    #  define OSG_EXPORT
#endif

Since CMake findModule for OSG will not automatically pass OSG_LIBRARY_STATIC linkage against OSG will fail in static builds on windows. As such if defined( OSG_LIBRARY_STATIC ) should be changed to if TRUE for static windows builds

@Neumann-A Neumann-A added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Feb 28, 2020
@JackBoosY
Copy link
Contributor

I will fix them after #10082 merged.

@JackBoosY
Copy link
Contributor

@Neumann-A I see that many header files contain similar content. Should we define OSG_LIBRARY_STATIC in one file to solve this issue? And which header file do we usually include osg first?

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support and removed category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Nov 6, 2020
@LilyWangLL
Copy link
Contributor

@Neumann-A I see that many header files contain similar content. Should we define OSG_LIBRARY_STATIC in one file to solve this issue? And which header file do we usually include osg first?

Ping @Neumann-A for response.

@Neumann-A
Copy link
Contributor Author

Just define it before the api export defs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

3 participants