From 87dab59e8e56b47e7a35078a14a87e0f9355af05 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Fri, 29 Nov 2013 17:00:01 +0100 Subject: Use the process we install to libexec Via QLibraryInfo. Also pick the name from qmake, and drop the hardcoded value. Add better error reporting when this fails. Change-Id: I44891a16f079b6c3c334f7f2bafa9edc0b4d69e4 Reviewed-by: Andras Becsi --- src/core/content_main_delegate_qt.cpp | 21 ++++++++++++--------- src/core/core_gyp_generator.pro | 6 ++---- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src/core') diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 9798d6f70..c967cfd48 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -46,27 +46,30 @@ #include "ui/base/ui_base_paths.h" #include "ui/base/resource/resource_bundle.h" #include +#include +#include #include #include #include "content_client_qt.h" #include "type_conversion.h" -static QByteArray subProcessPath() { - static bool initialized = false; -#ifdef QTWEBENGINEPROCESS_PATH - static QByteArray processPath(QTWEBENGINEPROCESS_PATH); -#else - static QByteArray processPath; +#ifndef QTWEBENGINEPROCESS_NAME +#error "No name defined for QtWebEngine's process" #endif +static QString subProcessPath() { + static bool initialized = false; + static QString processPath (QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) + % QDir::separator() % QStringLiteral(QTWEBENGINEPROCESS_NAME)); if (initialized) return processPath; + // Allow overriding at runtime for the time being. const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH"); if (!fromEnv.isEmpty()) - processPath = fromEnv; - if (processPath.isEmpty()) - qFatal("QTWEBENGINEPROCESS_PATH environment variable not set or empty."); + processPath = QString::fromLatin1(fromEnv); + if (processPath.isEmpty() || !QFileInfo(processPath).exists()) + qFatal("QtWebEngineProcess not found at location %s. Try setting the QTWEBENGINEPROCESS_PATH environment variable.", qPrintable(processPath)); initialized = true; return processPath; } diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index a13e8e26e..f03757a3a 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -20,10 +20,8 @@ qtHaveModule(v8): QT_PRIVATE += v8-private # Defining keywords such as 'signal' clashes with the chromium code base. DEFINES += QT_NO_KEYWORDS \ - Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS - -# We need a way to tap into gyp´s Debug vs. Release configuration -PER_CONFIG_DEFINES = QTWEBENGINEPROCESS_PATH=\\\"$$getOutDir()/%config/$$QTWEBENGINEPROCESS_NAME\\\" + Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS \ + QTWEBENGINEPROCESS_NAME=\\\"$$QTWEBENGINEPROCESS_NAME\\\" # Keep Skia happy CONFIG(release, debug|release): DEFINES += NDEBUG -- cgit v1.2.3