Skip to content

Fix qtwebengine build in the presence of libprotobuf (on Mac)

I am not sure this is an acceptable solution, but the only one I could come up with, so far. Tested and works on the M1 Mac.

Background: When libs/protobuf is installed, the qtwebengine build will pick it up for some of the build process, causing two different versions (the internal one in qtwebengine, and the system one) to be used, causing the build to fail. libs/protobuf is used in marble and opencv. Not sure, whether only Mac is affected. Should qtwebengine be crafted (and cached) before protobuf, then the problem would not be noticed.

Other solutions:

  • I tried disabling the use of system protobuf in the build (qmake checks for it), but this did not appear to have any effect on the build at all.
  • I tried fixing the include path ordering so that the internal protobuf would always be seen, first, but did not succeed.
  • A different option could be to downgrade protobuf to 3.9.0 (matching the qtwebengine version), but of course this isn't pretty either, and guaranteed to break, soon.

The build config is fairly complex, and note that any attempt involves a rather long build (with the breakage all the way at the end), so going with trial and error is not a lot of fun. Thus I hope this patch is still acceptable, even if ugly.

Merge request reports