Skip to content

Building Cef from source

Alex Maitland edited this page May 18, 2015 · 18 revisions

Requirements:

  • Depot Tools (Or use an existing Python2.7 install and depot_tools will be downloaded automatically as part of the automated process).
  • Visual Studio 2013 Community or Professional Update 4
  • Windows 8.1 SDK
  • Lots of Drive Space and Memory!
  • and last but not least a lot of time on your hands

The downloading/building of CEF is very much an automated process. (Generating the VS2013 project files is done manually)

  1. Install Depot Tools (optional should you already have a Python2.7 install in your path)
  2. Create a directory on a drive of your computer (for this tutorial we'll use c:\cefsource)
  3. Download the automate.git.py Python script to c:\cefsource
  4. Open a dos command prompt ( run as administrator )
  5. Change directory to c:\cefsource
  6. Set the GYP environment variables.
cd c:\cefsource
# SET some GYP environment variables by typing
set GYP_GENERATORS=ninja,msvs-ninja
set GYP_MSVS_VERSION=2013

You are now ready to run the CEF automated git workflow

  1. At your command prompt, execute the following (Note If you installed Depot Tools then it automatically installs Python):
python automate-git.py --download-dir=c:\cefsource\source

this will run the automate-git.py script and start downloading the sources needed to build cef into c:\cefsource\source folder. The version of CEF that will be downloaded is the Dev Channel (master)

If you need to download a different branch of CEF, use:

python automate-git.py --download-dir=c:\cefsource\source --branch=branch_number_here

example

python automate-git.py --download-dir=c:\cefsource\source --branch=2272

will download and build the cef branch # 2272

Note that this script will also download the corresponding version of chromium which is needed to rebuild `CEF from source.

This script will run for a long time ( hours ) and when it is done you will find the Chromium and CEF sources in your c:\cefsource folder, binary distributions of CEF in C:\cefsource\chromium\src\cef\binary_distrib

You can patch CEF if you would like, by dropping patches in the C:\cefsource\chromium\src\cef\patch\patches and editing C:\cefsource\chromium\src\cef\patch\patch.cfg

#####To generate Visual Studio 2013 project files

# at your dos command prompt type
cd C:\cefsource\chromium\src\cef

and run the cef_create_projects.bat batch file ( by typing cef_create_projects.bat and pressing Enter)

when that batch file has finished running, you will find the Visual Studio 2013 solution cef.sln under C:\cefsource\chromium\src\cef and all of the CEF Visual Studio Project files.

Clone this wiki locally