Skip to content

Commit 05366f2

Browse files
committed
Added support for building CEF 64-bit on Windows.
The compile.bat script now automates building of vcproj files. Removed cefpython.pyd.manifest - it's not required to embed it in the .pyd module. The subprocess now compiles using /MT flag and doesn't depend on VC90 CRT libraries. Updated instructions on the BuildOnWindows wiki page.
1 parent 22413f2 commit 05366f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4325
-673
lines changed

cefpython/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ console.log
1818
*.user
1919
*.aps
2020
*.sdf
21+
*.sln
2122
Debug*/
2223
Release*/
2324
*.pdb

cefpython/cef3/client_handler/client_handler.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

cefpython/cef3/client_handler/client_handler_py27.vcproj renamed to cefpython/cef3/client_handler/client_handler_py27_32bit.vcproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<VisualStudioProject
33
ProjectType="Visual C++"
44
Version="9.00"
5-
Name="client_handler_py27"
5+
Name="client_handler_py27_32bit"
6+
RootNamespace="client_handler_py27_32bit"
67
ProjectGUID="{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}"
7-
RootNamespace="client_handler_py27"
88
Keyword="Win32Proj"
99
TargetFrameworkVersion="0"
1010
>
@@ -18,8 +18,8 @@
1818
<Configurations>
1919
<Configuration
2020
Name="Release|Win32"
21-
OutputDirectory="Release_py27"
22-
IntermediateDirectory="Release_py27"
21+
OutputDirectory="Release_py27_32bit"
22+
IntermediateDirectory="Release_py27_32bit"
2323
ConfigurationType="4"
2424
>
2525
<Tool
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="9.00"
5+
Name="client_handler_py27_64bit"
6+
RootNamespace="client_handler_py27_64bit"
7+
ProjectGUID="{1CB66137-15F8-4261-91DF-46B32A1EBC97}"
8+
Keyword="Win32Proj"
9+
TargetFrameworkVersion="0"
10+
>
11+
<Platforms>
12+
<Platform
13+
Name="x64"
14+
/>
15+
</Platforms>
16+
<ToolFiles>
17+
</ToolFiles>
18+
<Configurations>
19+
<Configuration
20+
Name="Release|x64"
21+
OutputDirectory="Release_py27_64bit"
22+
IntermediateDirectory="Release_py27_64bit"
23+
ConfigurationType="4"
24+
>
25+
<Tool
26+
Name="VCPreBuildEventTool"
27+
/>
28+
<Tool
29+
Name="VCCustomBuildTool"
30+
/>
31+
<Tool
32+
Name="VCXMLDataGeneratorTool"
33+
/>
34+
<Tool
35+
Name="VCWebServiceProxyGeneratorTool"
36+
/>
37+
<Tool
38+
Name="VCMIDLTool"
39+
/>
40+
<Tool
41+
Name="VCCLCompilerTool"
42+
AdditionalIncludeDirectories="../;$(PYTHON_INCLUDE_PATH);C:\Python27_x64\include;C:\Python27_amd64\include;C:\Python27_64\include"
43+
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;"
44+
ExceptionHandling="1"
45+
RuntimeLibrary="2"
46+
UsePrecompiledHeader="0"
47+
WarningLevel="3"
48+
Detect64BitPortabilityProblems="false"
49+
DebugInformationFormat="3"
50+
/>
51+
<Tool
52+
Name="VCManagedResourceCompilerTool"
53+
/>
54+
<Tool
55+
Name="VCResourceCompilerTool"
56+
/>
57+
<Tool
58+
Name="VCPreLinkEventTool"
59+
/>
60+
<Tool
61+
Name="VCLibrarianTool"
62+
/>
63+
<Tool
64+
Name="VCALinkTool"
65+
/>
66+
<Tool
67+
Name="VCXDCMakeTool"
68+
/>
69+
<Tool
70+
Name="VCBscMakeTool"
71+
/>
72+
<Tool
73+
Name="VCFxCopTool"
74+
/>
75+
<Tool
76+
Name="VCPostBuildEventTool"
77+
/>
78+
</Configuration>
79+
</Configurations>
80+
<References>
81+
</References>
82+
<Files>
83+
<Filter
84+
Name="Header Files"
85+
Filter="h;hpp;hxx;hm;inl;inc;xsd"
86+
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
87+
>
88+
<File
89+
RelativePath=".\client_handler.h"
90+
>
91+
</File>
92+
<File
93+
RelativePath=".\cookie_visitor.h"
94+
>
95+
</File>
96+
<File
97+
RelativePath=".\resource_handler.h"
98+
>
99+
</File>
100+
<File
101+
RelativePath=".\web_request_client.h"
102+
>
103+
</File>
104+
<File
105+
RelativePath=".\string_visitor.h"
106+
>
107+
</File>
108+
<File
109+
RelativePath=".\request_context_handler.h"
110+
>
111+
</File>
112+
<File
113+
RelativePath=".\dpi_aware.h"
114+
>
115+
</File>
116+
<File
117+
RelativePath=".\task.h"
118+
>
119+
</File>
120+
</Filter>
121+
<Filter
122+
Name="Resource Files"
123+
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
124+
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
125+
>
126+
</Filter>
127+
<Filter
128+
Name="Source Files"
129+
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
130+
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
131+
>
132+
<File
133+
RelativePath=".\client_handler.cpp"
134+
>
135+
</File>
136+
<File
137+
RelativePath=".\cookie_visitor.cpp"
138+
>
139+
</File>
140+
<File
141+
RelativePath=".\resource_handler.cpp"
142+
>
143+
</File>
144+
<File
145+
RelativePath=".\web_request_client.cpp"
146+
>
147+
</File>
148+
<File
149+
RelativePath=".\string_visitor.cpp"
150+
>
151+
</File>
152+
<File
153+
RelativePath=".\request_context_handler.cpp"
154+
>
155+
</File>
156+
<File
157+
RelativePath=".\dpi_aware.cpp"
158+
>
159+
</File>
160+
<File
161+
RelativePath=".\task.cpp"
162+
>
163+
</File>
164+
</Filter>
165+
</Files>
166+
<Globals>
167+
</Globals>
168+
</VisualStudioProject>

cefpython/cef3/client_handler/client_handler_py32.vcproj renamed to cefpython/cef3/client_handler/client_handler_py34_32bit.vcproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<VisualStudioProject
33
ProjectType="Visual C++"
44
Version="9.00"
5-
Name="client_handler_py32"
5+
Name="client_handler_py34_32bit"
6+
RootNamespace="client_handler_py34_32bit"
67
ProjectGUID="{37AA7CD9-67AD-40B1-ADC0-D62173764BCA}"
78
Keyword="Win32Proj"
89
TargetFrameworkVersion="0"
@@ -17,8 +18,8 @@
1718
<Configurations>
1819
<Configuration
1920
Name="Release|Win32"
20-
OutputDirectory="Release_py32"
21-
IntermediateDirectory="Release_py32"
21+
OutputDirectory="Release_py34_32bit"
22+
IntermediateDirectory="Release_py34_32bit"
2223
ConfigurationType="4"
2324
>
2425
<Tool
@@ -38,7 +39,7 @@
3839
/>
3940
<Tool
4041
Name="VCCLCompilerTool"
41-
AdditionalIncludeDirectories="../;$(PYTHON_INCLUDE_PATH);C:\Python32\include"
42+
AdditionalIncludeDirectories="../;$(PYTHON_INCLUDE_PATH);C:\Python34\include"
4243
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;"
4344
ExceptionHandling="1"
4445
RuntimeLibrary="2"

cefpython/cef3/linux/installer/make-deb.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ def remove_directories_from_previous_run():
9696
if os.path.exists(DISTUTILS_SETUP):
9797
log("The Distutils setup directory already exists, removing..")
9898
shutil.rmtree(DISTUTILS_SETUP)
99-
99+
100100
if os.path.exists(INSTALLER+"/deb_dist/"):
101101
log("The deb_dist/ directory already exists, removing..")
102102
shutil.rmtree(INSTALLER+"/deb_dist/")
103-
103+
104104
if os.path.exists(INSTALLER+"/deb_archive/"):
105105
log("The deb_archive/ directory already exists, removing..")
106106
shutil.rmtree(INSTALLER+"/deb_archive/")
@@ -115,15 +115,15 @@ def create_distutils_setup_package():
115115
def modify_control_file():
116116
log("Modyfing debian control file")
117117
control_file = DEBIAN+"/control"
118-
118+
119119
# Read contents
120120
with open(control_file, "r") as f:
121121
contents = f.read()
122-
122+
123123
# Set architecture to i386 or amd64
124124
contents = contents.replace("Architecture: all",
125125
"Architecture: %s" % ARCHITECTURE)
126-
126+
127127
# Extend the Package section, remove the two ending new lines
128128
contents = re.sub("[\r\n]+$", "", contents)
129129
contents += "\n"
@@ -134,11 +134,11 @@ def modify_control_file():
134134
description = re.sub("\n$", "", description)
135135
contents += "%s\n" % description
136136

137-
# Other fields
137+
# Other fields
138138
contents += "Version: %s-1\n" % VERSION
139139
contents += "Maintainer: %s\n" % MAINTAINER
140140
contents += "Homepage: %s\n" % HOMEPAGE
141-
141+
142142
# Control file should end with two new lines
143143
contents += "\n"
144144
with open(control_file, "w") as f:
@@ -177,11 +177,11 @@ def copy_postinst_script():
177177
# executables, so that they appear to be in one directory.
178178
# CEF executable requires that libcef.so and the subprocess
179179
# executable are in the same directory.
180-
# This solution does not to work correctly in CEF3 branch
180+
# This solution does not to work correctly in CEF3 branch
181181
# 1650, so we will have to put .so libraries along with
182182
# other files in a real single directory.
183183
log("Copying .postinst script")
184-
shutil.copy(INSTALLER+"/debian.postinst",
184+
shutil.copy(INSTALLER+"/debian.postinst",
185185
DEBIAN+"/python-%s.postinst" % (PACKAGE_NAME))
186186

187187
def create_debian_source_package():
@@ -242,16 +242,16 @@ def modify_deb_archive():
242242
deb_archive_name = "python-%s_%s-1_%s.deb" \
243243
% (PACKAGE_NAME, VERSION, ARCHITECTURE)
244244
deb_archive_dir = INSTALLER+"/deb_archive"
245-
245+
246246
# Move the deb archive to the deb_archive/ directory
247247
log("Moving the deb archive")
248248
os.system("mkdir %s" % deb_archive_dir)
249249
os.system("mv %s %s" % (DEB_DIST+"/"+deb_archive_name,\
250250
deb_archive_dir+"/"+deb_archive_name))
251-
251+
252252
# Remove the deb_dist/ directory
253253
os.system("rm -rf %s" % DEB_DIST)
254-
254+
255255
# Extract the deb archive
256256
log("Extracting the deb archive")
257257
os.chdir(deb_archive_dir)
@@ -293,7 +293,7 @@ def modify_deb_archive():
293293
% cefpython3_public_file, shell=True).strip()
294294
replace_in_file(md5sums_file, old_md5sum, new_md5sum)
295295

296-
# Create deb archive from the modified ./DEBIAN/ and
296+
# Create deb archive from the modified ./DEBIAN/ and
297297
# ./usr/ directories.
298298
log("Creating deb archive from the modified files")
299299
os.system("fakeroot dpkg-deb -b . ./%s" % deb_archive_name)
@@ -310,7 +310,7 @@ def main():
310310
# Version
311311
global VERSION
312312
VERSION = args.version
313-
313+
314314
# Paths
315315
global DISTUTILS_SETUP
316316
DISTUTILS_SETUP = INSTALLER+"/"+PACKAGE_NAME+"-"+args.version+"-"+\
@@ -319,13 +319,13 @@ def main():
319319
remove_directories_from_previous_run()
320320
create_distutils_setup_package()
321321
create_debian_source_package()
322-
deb_dist_cleanup()
322+
deb_dist_cleanup()
323323
modify_control_file()
324324
create_copyright_file()
325325
copy_postinst_script()
326326
create_debian_binary_package()
327327
modify_deb_archive()
328-
328+
329329
log("DONE")
330330

331331
if __name__ == "__main__":

cefpython/cef3/linux/setup/setup.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,7 @@ def CompileTimeConstants():
9494
# './'
9595
#],
9696

97-
# /EHsc - using STL string, multimap and others that use C++ exceptions.
9897
extra_compile_args=[],
99-
100-
# '/ignore:4217' - silence warnings: "locally defined symbol _V8FunctionHandler_Execute
101-
# imported in function "public: virtual bool __thiscall V8FunctionHandler::Execute".
102-
# client_handler or other vcprojects include setup/cefpython.h,
103-
# this is a list of functions with "public" statement that is
104-
# accessible from c++.
10598
extra_link_args=[],
10699

107100
# Defining macros:

0 commit comments

Comments
 (0)