-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[imgui-sfml] Force imgui-sfml to be a static library #10840
Conversation
I was one of those affected by issue #9660. I tried this PR and it indeed fixes the crash. There is one new small annoyance though. On Windows (at least), I now get link errors unless I add opengl32.lib to my project, which was not required when this was a dynamic library. I'm not sure if this is to be expected or if there is a way to automatically link to opengl32.lib too using vcpkg. I tested with VS2019 in Debug x64 configuration. Sample of link errors:
|
@VincentZalzal The issue that the system library is not automatically added after integration using the msvc project(sln/vcxproj) is currently unresolved. So you need to add them manually now. |
@JackBoosY That's ok, it's still a lot better to be able to use vcpkg to handle all the rest! |
@Neumann-A At present, |
there is |
- if (NOT BUILD_SHARED_LIBS) | ||
- set(SFML_STATIC_LIBRARIES ON) | ||
- endif() | ||
find_package(SFML COMPONENTS graphics system window) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The consuming package should not need to care about whether SFML is static or dynamic -- we should introduce a vcpkg-cmake-wrapper in the sfml package that resolves this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ras0219-msft
Here, SFML_STATIC_LIBRARIES
is forced to be BUILD_SHARED_LIBS
, which causes sfml
to be associated with imgui-sfml
build type. So I think it needs to be removed here.
Since vcpkg_check_linkage
changes the value of VCPKG_LIBRARY_LINKAGE
, if we set this value in vcpkg-cmake-wrapper
, we cannot use VCPKG_LIBRARY_LINKAGE
to determine what VCPKG_LIBRARY_LINKAGE
should be set to.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@strega-nil Please review this PR. Thanks. |
Cool, thanks @JackBoosY :) |
This has been merged broken despite @Neumann-A review... :( |
@Neumann-A @cenit I will continue to fix this issue. |
oh shoot, I'm sorry -.- |
Force imgui-sfml to be a static library to avoid the issue of loading global variables in imgui twice.
Related: #9660.