Chromium browser Development Series The second article: How to compile the latest chromium source code

Source: Internet
Author: User

Say why so late to send the second article, last week and this week department work too much, the evening is 10:30 from the company, go home after really no extra energy to touch the keyboard. So please forgive us!

Previous Period review:

Chromium Source Download:

1. Find a reliable VPN (I tried, the internet said no VPN take the code is not reliable);

2. Get Depot_tools, unzip, set environment variables;

3.gclient get Python and GIT,SVN, set environment variables;

4.fetch–nohooks Chromium–nosvn=true Obtain the source code;

5.gclientsync--force–nohooks sync to the latest

The upper Python and git can also be manually installed, as long as the environment variable is set.

Environment configuration:

The final step in getting the code is to get the compilation environment, which is visual Studio 2013, and all of the above are successful, and running gclient runhooks will download the vs2013 files that are needed for the compilation to local, stored in the Depot_tools\win_ Toolchain\vs2013_files path, the primary file is the library file that is required for compiling.

A few notes on compiling Chromium's website on Windows:

1. You must set your Windows system locale to English, otherwise the error will occur at compile time: "The file contains a character that cannot berepresented in the current code page." This problem can also be solved without switching languages. Please look down.

2. Since there are some problems with the previous Visual Studio Express (Free edition), Microsoft has also done a fix in update4, so now the official website describes using Visual Studio Update4 ( Version community or Professional) to compile, the other version is not supported. In addition the Windows system version must be win7 64-bit later version, 32-bit is already unsupported.

Some other notes:

Select the compiled version:

First switch to the SRC directory, listing all versions of the label, the following command records the label into the tags.txt text: git tag >>tags.txt 2>&1

When opened with notepad++, only the latest tag is intercepted:

You can switch to a tag to compile, command and switch to the same branch, using the following command:

git checkout-b chrome_43.0.2355.2_local_branch 43.0.2355.2

Create local branch chrome_43.0.2355.2_local_branch and switch to remote 43.0.2355.2tag

Check for success with Git branch:

Sync Code:

Gclient sync--nohooks--with_branch_heads--with_tags--OUTPU

t-json= "Log.json" –jobs 16

Using--nohooks can reduce information such as checking the compilation environment every time.

Compile:

1) Build the project and generate a sln that can be opened with vs2013 for easy debugging and later use. Write as batch file execution:

Set gyp_msvs_version=2013

Set Gyp_generators=msvs-ninja,ninja

Set Gyp_defines=component=shared_library

Set path=c:\depot_tools\python276_bin\; C:\depot_tools\;

Python.exe Src/build/gyp_chromiumsrc/chrome/chrome.gyp >>log.txt 2>&1

2) Compile the project

Set path=c:\depot_tools\;

Ninja-c Src\out\debug chrome>>log.txt 2>&1

The above two steps put the generated log in Log.txt for easy viewing.

Description

1.set Gyp_generators=msvs-ninja,ninja

The latest code generation project, because Msvs-ninja can not open some files, should affect the small

2.set Gyp_defines=branding=chromium Proprietary_codecs=1 Buildtype=dev

Optimization settings, you can set

3.set depot_tools_win_toolchain=0

Set to 0 is to let Gclient do not automatically go to build the environment, using the native existing environment, may modify more places, such as setting set Gyp_defines=windows_sdk_path= "C:\Program Files (x86) \ Windows kits\8.0 ", the path to some JSON files, and so on. The default is 0.

Because compiling chromium source code to warning strict requirements, so I listed the more important warning solution:

1. For coding issues, and language issues.

Workaround: The latest version has waring4996 included, but no 4819, plus it, will solve a lot of trouble.

In the Src\build\common.gypi file, add:

Attach the official instructions for compiling parameters:

View the address of the version number online:

http://omahaproxy.appspot.com/

After that I will be rolling out some of the articles about chromium, please continue to pay attention to.

If you have questions about this series of articles, you can directly in the public message, the first time to contact the original author to help you patiently answer.

Technicians have their own feelings, deep in which they are not understood, welcome to the personal public platform: the Programmer Interaction Alliance (Coder_online), a developer's home, to tell their story.

Chromium browser Development Series The second article: How to compile the latest chromium source code

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.