-
Notifications
You must be signed in to change notification settings - Fork 1.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: make backends available as optional components #25325
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3a803d1
to
3746762
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b105a72
to
57dc335
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4e686f8
to
c44ea09
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
71ab988
to
e31ca15
Compare
This comment has been minimized.
This comment has been minimized.
e31ca15
to
be4be74
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hooks produced the following warnings for commit 9f6b90eimgui/1.86@#f71b2c36f40b6b38a05c882e11fe20bf
imgui/1.85@#5b7ab2f3ec1b8f0fe42e0d230d1d99a7
|
This comment has been minimized.
This comment has been minimized.
867b73a
to
2b349e6
Compare
Conan v1 pipeline ✔️All green in build 26 (
Conan v2 pipeline ✔️
All green in build 26 (
|
Hooks produced the following warnings for commit 2b349e6imgui/1.86@#6c07b2eebf35b7365ace7efe78b7e7de
imgui/1.85@#d6f43ac34007b753a47994a8d1303440
|
The recipe is ready for review. |
Summary
Changes to recipe: imgui/[*]
Motivation
There are two major issues with the current approach of building only the core
imgui.cpp
and no backends or other optional components:<package_folder>/res/...
source files into the build system in order to use the optional components. This is manageable but very inconvenient compared to the alternative of linking against a suitable component target.IMGUI_API
export macro for shared builds and visibility handling. The users need to take care that the core library symbols provided by the imgui recipe and the optional components built by the consuming projects have the correctIMGUI_API
corresponding the static/shared build of either project. This is tricky to manage and easy to mess up.In addition to that, the current recipe does not provide a way to modify
imconfig.h
. These values cannot be changed after the core library has already been built.Another minor benefit is that the Conan and system dependencies for the optional components are handled by
package_info()
in the imgui recipe and don't need to be duplicated in the consuming projects.Details
The PR aims to be backwards-compatible.
imgui::imgui
CMake target still links against the core library only. All backends can be disabled altogether by settingbuild_backends=False
for the old behavior.These changes are not without their downsides:
imgui::imgui
as acpp_info.requires
either explicitly or implicitly no longer link against just the core lib but against all the optional components as well.Given these downsides, I was initially hesitant to open this PR and shelved it for a while, but after hitting a wall in the Ogre PR (#21073) when trying to unvendor ImGui there, this PR started to look a lot more reasonable. That is, Ogre expects the optional Freetype component to be available and building it as part of the Ogre recipe hits the shared build issues listed above.
Test build with nearly all options enabled (only DirectX 11 and DirectX 12 disabled): #25325 (comment)