From 9853a1edc5ed67dca17abc68395849bd9e117fa9 Mon Sep 17 00:00:00 2001 From: cztomczak Date: Wed, 5 Apr 2017 07:12:02 +0200 Subject: [PATCH] Fix build on Linux --- docs/Build-instructions.md | 9 +++------ src/subprocess/cefpython_app.cpp | 7 ++++++- tools/automate.py | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/Build-instructions.md b/docs/Build-instructions.md index 3281810e..c35ac91a 100644 --- a/docs/Build-instructions.md +++ b/docs/Build-instructions.md @@ -183,7 +183,7 @@ requirements common for all platforms. ### Linux -* Install packages: `sudo apt-get install python-dev cmake g++ libgtk2.0-dev libgtkglext1-dev` +* Install packages: `sudo apt-get install cmake g++ libgtk2.0-dev libgtkglext1-dev` * If building CEF from sources: * Official binaries are built on Ubuntu 14.04 (cmake 2.8.12, g++ 4.8.4) * Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later @@ -200,11 +200,8 @@ requirements common for all platforms. [cef/BuildingOnDebian7.md](https://bitbucket.org/chromiumembedded/cef/wiki/BuildingOnDebian7.md) and [cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575), and [cef/#1697](https://bitbucket.org/chromiumembedded/cef/issues/1697) -* If building CEF from sources, 32-bit on 64-bit machine: - * Follow the configuration [here](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration) - * To perform a 32-bit Linux build on a 64-bit Linux system see - Linux configuration in upstream cef/AutomatedBuildSetup.md. See also - [cef/#1804](https://bitbucket.org/chromiumembedded/cef/issues/1804). +* Building CEF 32-bit is only possible using cross-compiling on + 64-bit machine. See [Issue #328](https://github.com/cztomczak/cefpython/issues/328). * Sometimes it is also required to install these packages (eg. chroot): `sudo apt-get install libnss3 libnspr4 libxss1 libgconf-2-4` diff --git a/src/subprocess/cefpython_app.cpp b/src/subprocess/cefpython_app.cpp index 738728d8..1f51ba27 100644 --- a/src/subprocess/cefpython_app.cpp +++ b/src/subprocess/cefpython_app.cpp @@ -9,11 +9,14 @@ #include "common/cefpython_public_api.h" #endif -#if defined(OS_LINUX) +#ifdef BROWSER_PROCESS +#ifdef OS_LINUX #include +#include #include #include "print_handler_gtk.h" #endif +#endif #include "cefpython_app.h" #include "util.h" @@ -133,6 +136,7 @@ void CefPythonApp::OnRenderProcessThreadCreated( } CefRefPtr CefPythonApp::GetPrintHandler() { +#ifdef BROWSER_PROCESS #if defined(OS_LINUX) // For print handler to work GTK must be initialized. This is // required for some of the examples. @@ -141,6 +145,7 @@ CefRefPtr CefPythonApp::GetPrintHandler() { LOG_DEBUG << "Initialize GTK"; gtk_init(0, NULL); } +#endif #endif return print_handler_; } diff --git a/tools/automate.py b/tools/automate.py index 9e192eb1..cb97d8d2 100644 --- a/tools/automate.py +++ b/tools/automate.py @@ -30,7 +30,7 @@ [--force-chromium-update FORCE_CHROMIUM_UPDATE] [--no-cef-update NO_CEF_UPDATE] [--cef-branch BRANCH] [--cef-commit COMMIT] - [--build-dir BUILD_DIR] [--cef-build-dir CEF_BUIL_DDIR] + [--build-dir BUILD_DIR] [--cef-build-dir CEF_BUILD_DIR] [--ninja-jobs JOBS] [--gyp-generators GENERATORS] [--gyp-msvs-version MSVS] automate.py (-h | --help) [type -h to show full description for options] @@ -900,7 +900,7 @@ def run_command(command, working_dir, env=None): env = getenv() # When passing list of args shell cannot be True on eg. Linux, read # notes in build.py - shell=(platform.system() == "Windows") + shell = (platform.system() == "Windows") return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)