一、获取代码
a) 不下载代码,直接浏览,到这里: 或者这里:
b) 快速下载代码包(tarball),到这里: , 下载完代码包之后也可以继续使用步骤 c 来完成操作。
c) 使用工具gclient check out代码,下载这个工具:
i. 解压,加入path环境变量
ii. 运行下面的命令行取代码
cd c:\chromiumtrunk
gclient config https://src.chromium.org/chrome/trunk/src
gclient sync
iii. 运行下面的命令行生成sln文件
gclient runhooks --force
iv. 工具的具体使用看这里:
二、配置windows编译环境,编译代码(原文地址: )
a) 安装vs2010
b) 安装vs2010 sp1
c) 安装win sdk 8
i. 如果你的安装目录不是默认的目录,要增加以下的环境变量
GYP_DEFINES=windows_sdk_path="path to sdk"
d) 安装dxdsdk jun10
i. 添加 $(DXSDK_DIR)\include; to the beginning of the 'IncludePath' property in %LOCALAPPDATA%\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props.
ii. 添加 $(DXSDK_DIR)\lib\x86; to the beginning of the 'LibraryPath' property in the same file. At this point the .props file will look like this:
<?xml version="1.0" encoding="utf-8"?><Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup> <IncludePath>$(DXSDK_DIR)\include;$(IncludePath)</IncludePath> <LibraryPath>$(DXSDK_DIR)\lib\x86;$(LibraryPath)</LibraryPath></PropertyGroup>
</Project>iii. 同样的编辑文件: %LOCALAPPDATA%\Microsoft\MSBuild\v4.0\Microsoft.Cpp.x64.user.props:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <IncludePath>$(DXSDK_DIR)\include;$(IncludePath)</IncludePath> <LibraryPath>$(DXSDK_DIR)\lib\x64;$(LibraryPath)</LibraryPath></PropertyGroup></Project>iv. 不要用vs来编辑,直接用记事本吧,因为vs会增加一些编码。
v. 保证DirectX的SDK在查找顺序的第一位,否则会出现一些编译错误。
打开chrome.sln进行编译,初次编译预计5小时以上,看机器性能。