Skip to content

frontend: Fix build with Qt 6.10#12321

Closed
Chiitoo wants to merge 1 commit intoobsproject:masterfrom
Chiitoo:qt-6.10
Closed

frontend: Fix build with Qt 6.10#12321
Chiitoo wants to merge 1 commit intoobsproject:masterfrom
Chiitoo:qt-6.10

Conversation

@Chiitoo
Copy link
Copy Markdown
Contributor

@Chiitoo Chiitoo commented Jun 28, 2025

Description

Add Qt6GuiPrivate target to the Qt find_package() call to fix compiling against Qt 6.10.

Motivation and Context

The 'Qt6FooPrivate' targets have been split into separate CMake files in Qt 6.9, and require a 'find_package(Qt6FooPrivate)' call starting with Qt 6.10.

See also: https://bugreports.qt.io/browse/QTBUG-87776

How Has This Been Tested?

Tested compiling and running on Gentoo Linux with Qt 6.10.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@tytan652
Copy link
Copy Markdown
Collaborator

In our context, this is not the right fix.
When OBS is built with Qt 6.9 or later, GuiPrivate is normally completely unused.

The 'Qt6FooPrivate' targets have been split into separate CMake files
in Qt 6.9, and require a 'find_package(Qt6FooPrivate)' call starting
with Qt 6.10.

See also: https://bugreports.qt.io/browse/QTBUG-87776
@Chiitoo
Copy link
Copy Markdown
Contributor Author

Chiitoo commented Jun 28, 2025

In our context, this is not the right fix. When OBS is built with Qt 6.9 or later, GuiPrivate is normally completely unused.

I see.

@Chiitoo Chiitoo marked this pull request as draft June 28, 2025 12:58
@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Jun 28, 2025
@RytoEX
Copy link
Copy Markdown
Member

RytoEX commented Jun 30, 2025

The CMake formatting check is failing.

If OBS Studio itself does not use Qt6GuiPrivate, then I'm not convinced we need to merge this change.

@Chiitoo
Copy link
Copy Markdown
Contributor Author

Chiitoo commented Jul 1, 2025

The CMake formatting check is failing.

Noticed, but I didn't get into guessing what it isn't happy about yet exactly, as there seem to be no hints at all in the log, and that's probably not even necessary if this is not the correct way to fix the build.

If OBS Studio itself does not use Qt6GuiPrivate, then I'm not convinced we need to merge this change.

If it's not the proper way to go, certainly not, but the build failure will still be there.

At this time, as an alternative, I can only think of removing the link target if it's indeed unused, and a quick test shows that things do seem to at least compile if they are removed in the cmake files referenced to in the error messages:

CMake Error at frontend/cmake/os-linux.cmake:6 (target_link_libraries):
  Target "obs-studio" links to:

    Qt::GuiPrivate

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  frontend/CMakeLists.txt:81 (include)


CMake Error at frontend/plugins/frontend-tools/CMakeLists.txt:57 (target_link_libraries):
  Target "frontend-tools" links to:

    Qt::GuiPrivate

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

@tytan652
Copy link
Copy Markdown
Collaborator

tytan652 commented Jul 1, 2025

@Chiitoo #12328

@WizardCM
Copy link
Copy Markdown
Member

Closing in favour of #12328

@WizardCM WizardCM closed this Jul 12, 2025
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Dec 16, 2025
While obs-studio itself is built with 'disable-werror' these days,
'-Werror' in the the 'libobs.pc.in' causes other projects potentially
unwanted build issues [1].

Also add the qt-6.10 patch to the git build, since the fix
is still not merged upstream after half a year [2][3], and qt-6.10
has been out in the wilds for a while now.

1. https://bugs.gentoo.org/966311
2. obsproject/obs-studio#12321
3. obsproject/obs-studio#12328

Bug: https://bugs.gentoo.org/966311
Signed-off-by: Jimi Huotari <chiitoo@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Non-breaking change which fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants