-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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] Fix find dependencies #15063
Conversation
Special thanks to @thedmd for giving me technical help. |
@cloudhan Can you please test this PR? Thanks. |
The sample solution provided by @cloudhan has been successfully tested. |
# Conflicts: # ports/imgui/CONTROL
This PR makes very large, breaking changes to how users consume imgui through vcpkg; it moves the example backends out of the main library file and injects the sources into all consuming DLLs, static libs, and executables. I don't think this large change is warranted by the actual issue (#14753). The linked PR in imgui has been in development for the last two and a half years, so I don't think it's appropriate to assume it will be merged very soon and regardless should be done separately from solving issue at hand. |
Co-authored-by: Billy O'Neal <[email protected]>
@ras0219-msft The changes to this PR come from part of ocornut/imgui#1713. I think it is inappropriate for us to force imgui to be used as a library, which is also contrary to the official intention. This caused the previous problem that the variables in imgui were set twice(issue #9660). The modification in this PR fits the official definition of imgui (as a header-only library), and many people believe that this change is effective and reasonable. You can check the user's response in the upstream PR I provided. |
@strega-nil May I ask when this will be reviewed and merged? |
This PR is controversial because:
(See Robert's reply #15063 (comment) for more details) so it doesn't look like there's support to merge this right now, so it isn't a timeframe thing. Jack and Robert presumably need to have further discussion to figure out what happens. |
From the imgui README:
Imgui is not a header-only library; there are several files that must be compiled in order to use it. The official instructions for the core code are (almost perfectly) equivalent to linking it as a static library. There are three differences between prebuilding it as a static library compared to injecting the code into the consumer project:
The real reason why
Modifying the sources of imgui is expected to be a way to configure the library. However, this change (injecting the source into the consumer) does not fundamentally fix this issue without further efforts to ensure that a user-provided Today, the user can overlay a modified version of the file(COPY "${CMAKE_CURRENT_LIST_DIR}/imconfig.h" DESTINATION "${SOURCE_PATH}") which will work perfectly with building a static library and still enables full binary caching of The primary issue in #9660 would have been made no better by this change; it's net neutral (or worse!). The problem was that the Finally, the linked PR (ocornut/imgui#1713) has been in limbo for several years; it is unclear if it will be adopted as an official build. Even if it was, the author explicitly stated that the only purpose they see in having this build is to maintain the example apps:
which means there would still be no official buildsystem for consuming it as a library (since the author intends the user to copy the source code into their project). Even if I have committed several egregious errors above, we should separate fixing the issue in question (#14753, which really just needs some |
@ras0219 Fine, I will separate the new compilation method of bindings to another PR. |
Test complete locally on |
Thanks for your edits! |
find_dependency
.Fixes #14753.