Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Source/WebCore/PlatformQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ list(APPEND WebCore_LIBRARIES
${ZLIB_LIBRARIES}
)

if (Qt6Gui_VERSION VERSION_GREATER_EQUAL 6.10)
list(APPEND WebCore_PRIVATE_LIBRARIES Qt6::GuiPrivate)
endif ()
if (Qt6Network_VERSION VERSION_GREATER_EQUAL 6.10)
list(APPEND WebCore_PRIVATE_LIBRARIES Qt6::NetworkPrivate)
endif ()

if (QT_STATIC_BUILD)
list(APPEND WebCore_LIBRARIES
${STATIC_LIB_DEPENDENCIES}
Expand Down
14 changes: 6 additions & 8 deletions Source/cmake/OptionsQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ macro(CONVERT_PRL_LIBS_TO_CMAKE _qt_component)
endmacro()

macro(CHECK_Qt6_PRIVATE_INCLUDE_DIRS _qt_component _header)
# Qt6 provides private headers via Qt6::${_qt_component}Private target
find_package(Qt6${_qt_component}Private QUIET CONFIG)
set(CMAKE_REQUIRED_LIBRARIES Qt6::${_qt_component})

if (NOT TARGET Qt6::${_qt_component}Private)
message(FATAL_ERROR "Qt6::${_qt_component}Private target not found. Please make sure Qt6 private headers are installed.")
endif()
# Qt 6.10+ provides private headers via Qt6::${_qt_component}Private target
if (Qt6${_qt_component}_VERSION VERSION_GREATER_EQUAL 6.10)
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS ${_qt_component}Private)
list(APPEND CMAKE_REQUIRED_LIBRARIES Qt6::${_qt_component}Private)
endif ()

set(INCLUDE_TEST_SOURCE
"
Expand All @@ -85,9 +86,6 @@ macro(CHECK_Qt6_PRIVATE_INCLUDE_DIRS _qt_component _header)
"
)

# Use the Private target directly - it provides the include dirs automatically
set(CMAKE_REQUIRED_LIBRARIES Qt6::${_qt_component} Qt6::${_qt_component}Private)

check_cxx_source_compiles("${INCLUDE_TEST_SOURCE}" Qt6${_qt_component}_PRIVATE_HEADER_FOUND)

unset(INCLUDE_TEST_SOURCE)
Expand Down
8 changes: 7 additions & 1 deletion Tools/QtTestBrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ set(QtTestBrowser_SYSTEM_INCLUDE_DIRECTORIES

set(QtTestBrowser_LIBRARIES
Qt6::Gui
Qt6::GuiPrivate
Qt6::Network
Qt6::Widgets
WebKitWidgets
Expand All @@ -55,6 +54,13 @@ if (TARGET Qt6::PrintSupport)
list(APPEND QtTestBrowser_LIBRARIES Qt6::PrintSupport)
endif ()

if (Qt6Core_VERSION VERSION_GREATER_EQUAL 6.10)
list(APPEND QtTestBrowser_PRIVATE_LIBRARIES Qt6::CorePrivate)
endif ()
if (Qt6Gui_VERSION VERSION_GREATER_EQUAL 6.10)
list(APPEND QtTestBrowser_PRIVATE_LIBRARIES Qt6::GuiPrivate)
endif ()

Comment on lines 45 to +63
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qt6::GuiPrivate does not belong in QtTestBrowser_LIBRARIES, as it would "infect" dependents with the private dependency. Put it in QtTestBrowser_PRIVATE_LIBRARIES so it will not be transitory.

qt_add_resources(QtTestBrowser_SOURCES
QtTestBrowser.qrc
)
Expand Down