diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index fdbd5cbc9e6..c7ae9590f24 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -454,16 +454,20 @@ function(qt_internal_add_module target) set(fw_install_header_dir "${INSTALL_LIBDIR}/${fw_header_dir}") set(fw_output_header_dir "${QT_BUILD_DIR}/${fw_install_header_dir}") list(APPEND public_includes - # Add the lib/Foo.framework dir as include path to let CMake generate - # the -F compiler flag for framework-style includes to work. - "$" - # Add the framework Headers subdir, so that non-framework-style includes work. The # BUILD_INTERFACE Headers symlink was previously claimed not to exist at the relevant # time, and a fully specified Header path was used instead. This doesn't seem to be a # problem anymore. "$" "$" + + # Add the lib/Foo.framework dir as an include path to let CMake generate + # the -F compiler flag for framework-style includes to work. + # Make sure it is added AFTER the lib/Foo.framework/Headers include path, + # to mitigate issues like QTBUG-101718 and QTBUG-101775 where an include like + # #include might cause moc to include the QtCore framework shared library + # instead of the actual header. + "$" ) endif()