Tuesday, January 21, 2014

Building CEF with visual studio 2013

Building Chromium Embedded Framework project (CEF) is very easy. It just needs time. Lot's of time and disk space (~21Gb).

Install the Windows 8 SDK. Download depot_tools.zip and decompress them in C:\dev\depot_tools. Open cmd in the depot_tools folder and run "gclient" to install the tools. Add depot_tools to your PATH environment variable. Download the cef automate script posting the following command:
C:\dev>svn checkout http://chromiumembedded.googlecode.com/svn/trunk/cef3/tools/automate cef_automate
Download CEF using the automate script you just downloaded:
C:\dev> python cef_automate/automate.py --download-dir=webinosBrowser --ninja-build --depot-tools=depot_tools
Get some coffee and read a couple of books. This will take a long time. In order to start the build process go to webinosBrowser\chromium\src\cef\ and type:
set GYP_GENERATORS=ninja
cef_create_projects.bat
cd ..
ninja -C out/Debug cefclient
Note: If during the execution of "cef_create_projects", you get an
Exception: Environment variable "SYSTEMROOT" required to be set to valid path
set the environment variable GYP_MSVS_VERSION to your vs version, e.g:
Set GYP_MSVS_VERSION=2013
If everything is fine, you should have the minimal cef browser in webinosBrowser\chromium\src\out\Debug\cefclient.exe.

Tip: If you want to support non open formats (assuming you do have the license for them), you will need to add 'proprietary_codecs': 1 to your cef.gypi configuration. More details in the official bug report.

5 comments:

Krishna Kumar said...

Hi I followed you steps on windows 8.1 with VS 2013. But it is failed to build the projects.
I am getting some exception. can you let me know with the current automated-git.py whether it is succefully building or not. I am getting following exception in cef.gyp, cef.gypi

Enabled Psyco JIT.
Updating projects from gyp files...
Exception: string index out of range

Andrey Likhachev said...

I build CEF using git.
This command:


fetch --nohooks chromium --nosvn=True
cd src
gclient sync --nohooks --with_branch_heads
git getch
git checkout refs/remote/branch-heads/2272
gclient sync --jobs 16
git clone https://chromiumembedded@bitbucket.org/chromiumembedded/branches-2272-cef3.git cef
cd cef


set CEF_ENABLE_SANDBOX=0
set GYP_DEFINES ffmpeg_branding=Chrome proprietary_codecs=1 target_arch=x64 windows_sdk_path="C:\Program Files (x86)\Windows Kits\8.1"
set GYP_GENERATORS=ninja
set GYP_MSVS_VERSION=2013

cef_create_projects.bat
cd ..

Then you must disable warings 4996,4056,4756,4702,4273, in file build\common.gypi, in section msvs_disabled_warnings.

ninja -C out/Release_x64 cefclient cef_unittests

Krishna Kumar said...

I getting the same error while running gclient sync --jobs 16

Enabled Psyco JIT.
Updating projects from gyp files...
Exception: string index out of range

please let me know do i need to setup psyco jit module.

Krishna Kumar said...

I am using windows 8.1 and 64 bit OS to build.

Anonymous said...

Building with SVN is depricated, you can find the git instructions here:
https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding