diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-11-29 17:00:01 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-03 11:57:56 +0100 |
commit | 87dab59e8e56b47e7a35078a14a87e0f9355af05 (patch) | |
tree | 5761376fddbee6da45e0efab37cdfaef4f0e0f69 /src | |
parent | 3e635f23d06a622db23c7d3e99cae574735534d9 (diff) |
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 <andras.becsi@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/content_main_delegate_qt.cpp | 21 | ||||
-rw-r--r-- | src/core/core_gyp_generator.pro | 6 |
2 files changed, 14 insertions, 13 deletions
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 <QByteArray> +#include <QDir> +#include <QFileInfo> #include <QLibraryInfo> #include <QStringBuilder> #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 |