No secret before source code-hou Jie's STL source code analysis
The source code here mainly refers to reading the source code. Based on this definition, I personally slightly modified this sentence: "Source code + debugging" is no secret.
With the research attitude, today we have compiled the Chrome source code with VC ++ 2008 (now only 2008 of the VC ++ version is available on the machine). The compilation process is described as follows:
1. Use tortoisesvn to download the latest Chrome source code. If you download the code to the directory G:/Chrome/src/, the directory layout will be based on this assumption.
2. Prepare the source code for chrome dependency
A) download is not required.
During compilation, the third-party code that Chrome depends on should all be in "G:/Chrome/src/third_party", but it is strange that Chrome places six projects in "G: under/Chrome/src/deps/third_party. Some colleagues on the Internet also raised this issue. Their solution is to copy these six projects to "G:/Chrome/src/third_party", which is quite useful. However, I used junction, an official Microsoft tool, to solve this problem by creating soft links, based on the conservation-oriented society. Although hard drives are large, they still need to save money. The command used is as follows (note: command is executed in directory G:/Chrome/src ):
Junction src/third_party/icu38 G:/Chrome/src/deps/third_party/icu38
Junction src/third_party/cygwin G:/Chrome/src/deps/third_party/cygwin
Junction src/third_party/cygwin_src G:/Chrome/src/deps/third_party/cygwin_src
Junction src/third_party/python_24 G:/Chrome/src/deps/third_party/python_24
Junction src/third_party/WebKit G:/Chrome/src/deps/third_party/WebKit
Junction src/third_party/svn g:/Chrome/src/deps/third_party/SVN
Junction is http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
B) download
There are also five projects that need to be re-downloaded: Open-vcdiff, gtest, googleurl, V8, and breakpad.
The address for downloading open-vcdiff with tortoisesvn is http://src.chromium.org/svn/branches/official/build_154.9/src/sdch
Download to the local directory G:/Chrome/branches/build_154.9/src/SDCh
The address for downloading gtest with tortoisesvn is a http://googletest.googlecode.com/svn/trunk
Download to the local directory G:/Chrome/gtest/trunk
The address for downloading googleurl with tortoisesvn is http://google-url.googlecode.com/svn/trunk
Download to the local directory G:/Chrome/Google-URL/src
Using tortoisesvn to download V8 address is http://v8.googlecode.com/svn/trunk
Download to the local directory G:/Chrome/V8/trunk
The address for downloading breakpad with tortoisesvn is a http://google-breakpad.googlecode.com/svn/trunk
Download to the local directory G:/Chrome/Google-breakpad/trunk
The command used to create a soft link is as follows:
Junction src/SDCh/Open-vcdiff ../branches/build_154.9/src/SDCh/open_vcdiff/Depot/opensource/Open-vcdiff
Junction src/testing/gtest ../gtest/trunk
Junction src/googleurl ../Google-URL/src
Junction src/V8 ../V8/trunk
Junction src/breakpad/src ../Google-breakpad/trunk/src
C) Compile the V8 Project
Use vs 2008 to open and compile G:/Chrome/V8/trunk/tools/visual_studio/v8.sln. When you open it, you will be prompted to convert the project directly. There is no problem, after compilation, you should generate v8.lib in the directory G:/Chrome/V8/trunk/tools/visual_studio/debug/lib.
3. Modify the Chrome project
A) Modify G:/Chrome/src/build/debug. vsprops and set
<Tool
Name = "vclinkertool"
Linkincremental = "2"
/>
Modify
<Tool
Name = "vclinkertool"
Linkincremental = "2"
Additionaldependencies = "$ (solutiondir) ../V8/tools/visual_studio/debug/lib/v8.lib"
/>
B) Open G:/Chrome/src/Chrome/chrome. SLN, add the file G:/Chrome/src/testing/gtest/src/gtest-test-part.cc file to the project test/gtest
4. start compiling. Have a cup of boiling water and check out paper.
5. Run G:/Chrome/src/Chrome/debug/chrome.exe to check the compilation results.