CEF Chinese tutorial (Google Chrome browser control)-CEF Compilation

Source: Internet
Author: User

This section describes the Branch Information of Cef and describes how to download, compile, and package source code.

Background: The CEF project exists as a chromium Extension Project. The CEF and chromium maintain two versions, development version and release version. The source code of CEF can be compiled manually or automatically by using tools: the CEF project is constantly developing. You can see the entire project file trunk from here, because the current version follows the chromium, therefore, it is not recommended to use the current version to develop the product of the released version. The following link can be used to download the development source code of CEF: cef1-http://chromiumembedded.googlecode.com/svn/trunk/cef1 CeF3-http://chromiumembedded.googlecode.com/svn/trunk/cef3 remind: you click on the link above, you will find this is a SVN project directory, if you used VSS in the past, you may find SVN unfamiliar. Do not try to download the files one by one. Here is a simple way to download the entire folder: first download a tortoisesvn, and then install it, but you won't see any tortoisesvn running program, because it is embedded in windows, you should create an empty folder under any drive letter, right-click the folder, and choose tortoisesvn> export from the menu ], enter the above link in the URL file box and click OK. Now all the project files will be downloaded. Release Version: with the release of chromium, CEF also provides the latest release version. We recommend that you use the release version as the development product environment for the following reasons: 1. the binary CEF is compiled with a specific Chromium release version. the released version of CEF/chromium has been better tested and is more suitable for developing the released version of applications. release version is more stable 4. the CEF release may include the required chromium/WebKit version 5. updates made after CEF will not interfere with your release plan. The CEF version number is in the following format: x.y. z, where X is the main CEF version, Y is the release version, and Z is the CEF checkpoint. For more details about the CEF and chromium versions, you can find it in include/cef_version.h. The following table lists the current CEF Release versions:

Release Version Chromium version Cef1 support CeF3 support
963 17 Yes No
1025 18 Yes No
1084 19 Yes No
1180 21 Yes Yes
1271 23 Yes Yes
1364 25 Yes Yes
1453 26 Yes Yes

You can download the release version of CEF at the following link, where yyyy is the release version: cef1-http://chromiumembedded.googlecode.com/svn/branches/YYYY/cef1 CeF3-compiler here to compile the source code: currently supported in windows, mac OS-X and Linux environment to compile the source code, and to compile successfully, your computer must have at least 4 GB of system memory (because I use windows, therefore, in Mac or Linux environments, I have no translation requirements ). Before compiling chromium and Cef source code, you must configure your compiling environment: 1. install the necessary package for your operating system and development environment: in windows, click the link on the right: http://www.chromium.org/developers/how-tos/build-instructions-windows (which I will give in the next chapter) After configuring the operating system and compiling environment, you can also use the link to download tortoisesvn: performancef currently does not support component development windows-if multiple virual studio is installed in your operating system, you can set the environment variable gyp_msvs_version to an appropriate value. If you want to use vs2008 for compilation, you should set this value to 2008, If you want to use vs2010 express to compile the project, you should set this environment variable to 2010e. If it is another Visual Studio version, you need to go to the chomium help document to find more detailed information, but it is estimated that it should be the same routine. If you are vs2005, it is definitely set to 2005. Automatic method: the CEF provides tools to automatically download, compile, and package chromium and Cef source code. This method is equally useful for the development and release editions, you can perform the following automatic operations: 1. download the automatic tool automate. PY: Use the URL below SVN checkout:

http://chromiumembedded.googlecode.com/svn/trunk/cef1/tools/automate /path/to/automate
2. run automate. PY Script: You can run automate at any appropriate time. PY script (for example, the time when the CEF is submitted every day every week), and use the CEF version you want.
python /path/to/automate/automate.py --download-dir=/path/to/download --url=http://chromiumembedded.googlecode.com/svn/branches/1084/cef1
If this operation succeeds, a binary package will be created in/path/to/download/chromium/src/cef/binary_distrib. If you want to find the complete usage introduction, click the following link: The automate.readme.txt method is also perfectly integrated into some automatic compilation systems, such as teamcity. (After the translation, I feel cold, because of teamcity, tortiosesvn... I don't know anything about it. I think I have been working in year 34, but the road is getting farther and farther away from it. I spent more than two years in my previous company, but it was totally closed for more than two years. I spent some CAD every day, I used a good API to do some repetitive work, but I didn't learn any new technologies. Instead, I ended my old books. Now it's time to catch up. But in another thought, I will be able to catch up with me for a few more years. At my age, I will be able to catch up with me for a few more years?
What can I learn? Can I have a lunch box even though I don't talk about how prosperous it is ?)
Manual download:
Chromium and CEF can be manually downloaded and compiled, but this is more complex and is not recommended to all users. Development edition: The following download introduction is only applicable to cef1 & CeF3 development edition. 1. Install depot_tools and download the chromium source code. You can follow the link to compile. A. Install a version of SVN 1.6.x and add it to your path to B. Use SVN to download depot_tools

  svn co http://src.chromium.org/svn/trunk/tools/depot_tools

C. add the depot_tools directory to your path. In Windows, the depot_tools path should be placed before tortoisesvn. D. create a chromium checkout directory (for example,/path/to/chromium) and configure gclient as follows:

cd /path/to/chromiumgclient config http://src.chromium.org/chrome/trunk/src

Remind: you only need to copy the above section to cmd to run it.

2. Download chromium_build_compatibility.txt in the top-level directory of Cef and find the chromium version you need. This may change as the latest version of chromium changes. 3. Update chromium to the appropriate version.

cd /path/to/chromiumgclient sync --revision src@chromium_revision --jobs 8 --force

4. download the source code of CEF to the "CEF" folder, which must be included in the "src" folder directory of chromium. You 'd better download only cef1 or CeF3, not both, assume that your chromium source code is downloaded in "/path/to/chromium/src", then your CEF source code should be placed in "/path/to/chromium/src/CEF ". Note that no matter whether you use cef1 or CeF3, the folder name must be named "CEF"

cd /path/to/chromium/srcsvn co http://chromiumembedded.googlecode.com/svn/trunk/cef1 cef

Release: the basic operations of the release and Development editions are the same, except that the release is changed to release. For more information, see the original article link.
Manual compilation: 1. Run the cef_create_project script (with. bat, OS-X and. Sh in Windows) to generate a compilation file under Gyp Configuration

cd /path/to/chromium/src/cef./cef_create_projects.sh
2. Compile CEF in windows. You can use the. sln file of Visual Studio as an alternative. You can also run the script build_projects on the command line to compile the entire project,

cd /path/to/chromium/src/cef/toolsbuild_projects.sh Debug

Manual packaging: After compiling the development and release versions, you can use make_distrib tool (Windows with. bat, OS-X and Linux with. Sh) to create a binary distribution package.

cd /path/to/chromium/src/cef/toolsmake_distrib.sh

If the process succeeds, a binary distribution package is generated in the/path/to/chromium/src/cef/binary_distrib directory. You can view more usage information in the make_distrib.py script.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.