Skip to content

Commit 5f24f50

Browse files
committed
Add build_cpp_projects.py tool to build with Python 3 on Windows (cztomczak#121)...
Currently tested with Python 3.4. There are still required changes to automate.py tool to generate libcef_dll_wrapper libraries for all Python 2 and 3 compilers (VS2008, VS2010, VS2015). Update build instructions for Windows. Generate and use cefpython_fixed.h so that recompilation of C++ projects doesn't happen each time when rebuilding the cefpython module. Update README. Add requirements for all platforms. Fix incomplete pip install command.
1 parent 1837d34 commit 5f24f50

18 files changed

+432
-305
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ bots.
3636

3737
### v50+ releases
3838

39-
1. Can be installed on all platforms using `pip install` command
39+
1. Can be installed on all platforms using `pip install cefpython3` command
4040
2. Downloads are available on [GitHub Releases](../../releases) pages
4141
2. Windows support: 32-bit, Python 2.7
42+
(requirements: Windows 7+)
4243
3. Linux support: 64-bit, Python 2.7 / 3.4 / 3.5 / 3.6
44+
(requirements: Debian 7+ / Ubuntu 12.04+)
4345
4. Mac support: 64-bit, Python 2.7 / 3.4 / 3.5 / 3.6
46+
(requirements: MacOS 10.9+)
4447
5. Documentation is in the [docs/](docs) directory
4548
6. API reference is in the [api/](api) directory
4649
7. Additional documentation is in issues labelled [Knowledge Base]
@@ -51,9 +54,9 @@ bots.
5154
1. Downloads are available on [wiki pages](../../wiki#downloads)
5255
and on GH Releases tagged [v31.2](../../releases/tag/v31.2)
5356
2. Supports only Python 2.7
54-
3. Windows support: 32-bit and 64-bit
55-
4. Linux support: 32-bit and 64-bit
56-
5. Mac support: 32-bit and 64-bit
57+
3. Windows support: 32-bit and 64-bit (requirements: Windows XP+)
58+
4. Linux support: 32-bit and 64-bit (requirements: Debian 7+ / Ubuntu 12.04+)
59+
5. Mac support: 32-bit and 64-bit (requirements: MacOS 10.7+)
5760
6. Documentation is on [wiki pages](../../wiki)
5861
7. API reference is available in revision [169a1b2]
5962
(../../tree/169a1b20d3cd09879070d41aab28cfa195d2a7d5/docs/api)

api/WindowUtils.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,6 @@ Linux-only. This method is utilized in the PyQt example.
137137
Linux-only. Install xlib error handlers so that the application
138138
won't be terminated on non-fatal errors. Must be done after
139139
initializing GTK.
140+
141+
CEF Python calls this function automatically during a call to
142+
Initialize, so there is no need to call it manually anymore.

docs/Build-instructions.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,22 @@ requirements common for all platforms.
149149

150150
* Install an appropriate MS compiler for a specific Python version:
151151
https://wiki.python.org/moin/WindowsCompilers
152-
* For Python 2.7 install "Microsoft Visual C++ Compiler for Python 2.7"
153-
from [here](https://www.microsoft.com/en-us/download/details.aspx?id=44266)
154-
* When using "Visual C++ compiler for Python 2.7" you have to install
155-
"Microsoft Visual C++ 2008 Redistributable Package (x64)" from
156-
[here](https://www.microsoft.com/en-us/download/details.aspx?id=15336)
152+
* For Python 2.7 install "Microsoft Visual C++ Compiler for Python 2.7"
153+
from [here](https://www.microsoft.com/en-us/download/details.aspx?id=44266)
154+
* When using "Visual C++ compiler for Python 2.7" you have to install
155+
"Microsoft Visual C++ 2008 Redistributable Package (x64)" from
156+
[here](https://www.microsoft.com/en-us/download/details.aspx?id=15336)
157+
* For Python 2.7 copy "cefpython/src/windows/py27/stdint.h" to
158+
"%LocalAppData%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\"
159+
if does not exist
160+
* For Python 3.4 follow the instructions for installing Windows SDK 7.1.
161+
If you encounter issue with .NET Framework 4 then make registry edits
162+
as suggested here: [Windows SDK setup failure]
163+
(http://stackoverflow.com/a/33260090/623622).
164+
* For Python 3.4, if getting error:
165+
`Cannot open include file 'ammintrin.h': No such file or directory`
166+
then Copy that `ammitrin.h` file from for example VS 2015 installation
167+
directory or find this file on the web. This is a Microsoft issue.
157168
* To build CEF from sources:
158169
* Use Win7 x64 or later. 32-bit OS'es are not supported. For more details
159170
see [here](https://www.chromium.org/developers/how-tos/build-instructions-windows).
@@ -165,8 +176,6 @@ requirements common for all platforms.
165176
to PATH
166177
* You need about 16 GB of RAM during linking. If there is an error
167178
just add additional virtual memory.
168-
* For Python 2.7 copy "cefpython/src/windows/stdint.h" to
169-
"%LocalAppData%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\"
170179

171180

172181
### Linux

src/client_handler/client_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma once
88

99
#if defined(_WIN32)
10-
#include "../windows/stdint.h"
10+
#include <stdint.h>
1111
#endif
1212

1313
#include "common/cefpython_public_api.h"

src/client_handler/cookie_visitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#if defined(_WIN32)
8-
#include "../windows/stdint.h"
8+
#include <stdint.h>
99
#endif
1010

1111
#include "common/cefpython_public_api.h"

src/client_handler/request_context_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#if defined(_WIN32)
8-
#include "../windows/stdint.h"
8+
#include <stdint.h>
99
#endif
1010

1111
#include "common/cefpython_public_api.h"

src/client_handler/resource_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#if defined(_WIN32)
8-
#include "../windows/stdint.h"
8+
#include <stdint.h>
99
#endif
1010

1111
#include "common/cefpython_public_api.h"

src/client_handler/string_visitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#if defined(_WIN32)
8-
#include "../windows/stdint.h"
8+
#include <stdint.h>
99
#endif
1010

1111
#include "common/cefpython_public_api.h"

src/client_handler/web_request_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#if defined(_WIN32)
8-
#include "../windows/stdint.h"
8+
#include <stdint.h>
99
#endif
1010

1111
#include "common/cefpython_public_api.h"

src/common/cefpython_public_api.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
/* This is a wrapper around including cefpython.h that is generated
1+
/* This is a wrapper around including cefpython_fixed.h that is generated
22
by Cython. Functions marked with the 'public' keyword are exposed
33
to C through that header file. */
44

55
#ifndef CEFPYTHON_PUBLIC_API_H
66
#define CEFPYTHON_PUBLIC_API_H
77

88
#if defined(OS_WIN)
9-
#pragma warning(disable:4190) // cefpython.h extern C-linkage warnings
9+
#pragma warning(disable:4190) // cefpython_fixed.h extern C-linkage warnings
1010
#endif
1111

1212
#include "Python.h"
1313

14-
// cefpython.h declares public functions using DL_IMPORT and these
14+
// cefpython_fixed.h declares public functions using DL_IMPORT and these
1515
// macros are not available in Python 3.
1616
#ifndef DL_IMPORT
1717
#define DL_IMPORT(RTYPE) RTYPE
@@ -20,12 +20,12 @@
2020
#define DL_EXPORT(RTYPE) RTYPE
2121
#endif
2222

23-
// Includes required by "cefpython.h".
23+
// Includes required by "cefpython_fixed.h".
2424
#include "include/cef_client.h"
2525
#include "include/cef_urlrequest.h"
2626
#include "include/cef_command_line.h"
2727
#include "util.h"
2828

29-
#include "../../build/build_cefpython/cefpython.h"
29+
#include "../../build/build_cefpython/cefpython_fixed.h"
3030

3131
#endif // CEFPYTHON_PUBLIC_API_H

0 commit comments

Comments
 (0)