From e17211aac9328de202befbdd5c2b4e6852970701 Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Tue, 25 Feb 2014 16:36:03 +0100
Subject: [PATCH] Don't try to build examples if RPATH isn't available

QMAKE_LFLAGS_RPATH is stripped from the mkspecs in official
Arch Linux Qt packages.

Don't force building examples in this case to allow qtwebengine to
build using the system Qt with a straight qmake;make.

Change-Id: Id406d55d34c0d313d69ba9f689f8f24f33038824
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 qtwebengine.pro | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/qtwebengine.pro b/qtwebengine.pro
index 366446c7a..c3e56fe8e 100644
--- a/qtwebengine.pro
+++ b/qtwebengine.pro
@@ -1,8 +1,12 @@
 load(qt_build_config)
 
-# As long as we are a module separate from the rest of Qt, we want to unconditionally build examples.
-# Once part of Qt 5, this should be removed and we should respect the Qt wide configuration.
-QTWEBENGINE_BUILD_PARTS = $$QT_BUILD_PARTS
-QTWEBENGINE_BUILD_PARTS *= examples
+# Examples will only be able to find libQt5WebEngineCore.so if the proper RPATH was set on libQt5WebEngineWidgets.so
+# Arch Linux disables RPATH for security reasons.
+!isEmpty($$QMAKE_LFLAGS_RPATH) {
+    # As long as we are a module separate from the rest of Qt, we want to unconditionally build examples.
+    # Once part of Qt 5, this should be removed and we should respect the Qt wide configuration.
+    QTWEBENGINE_BUILD_PARTS = $$QT_BUILD_PARTS
+    QTWEBENGINE_BUILD_PARTS *= examples
+}
 
 load(qt_parts)
-- 
GitLab