编译windows下chromium,时间:20170619,
官方地址:https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
一. 系统要求:
1. 64位机器,至少8GB的内存,推荐16GB以上。(我用的Win10 64位虚拟机,内存按照8G来的);
2. 至少100GB的硬盘存储空间,格式为NTFS。FAT32不支持大于4GB的文件,而在git下载时的文件可能会有20GB+;
3. Visual studio 2015 update 3;
4. Win7+ (我用的Win10编译,此处可能有个坑,下文介绍);
二. 系统配置:
1. 安装Visual studio 2015 update3,并安装window sdk 14393,vs需要安装Visual C++的三个选项包括MFC,Universal Windows Apps Development Tools > Tools (1.4.1) and Windows 10 SDK (10.0.14393);
2. 14393的SDK安装时要安装Debugging Tools For Windows,我一开始安装的时候,不知为何没有安装这个,修复了下后,才有的;
三. 安装depot_tools:
1. 下载depot_tools bundle,然后解压,地址:https://storage.googleapis.com/chrome-infra/depot_tools.zip;
2. 将depot_tools放到PATH环境变量的开始位置,至少在你安装的python和git的前面,因为depot_tools里面会下载python,如果在你安装的python后面的话,可能会出一些不可预期的问题;
3. 添加环境变量DEPOT_TOOLS_WIN_TOOLCHAIN,并设为0;
4. 打开cmd.exe,运行gclient,在第一次运行的时候,gclient会安装python/msysgit等必要组件;
四. 获取源码:
1. 打开cmd,在你想放置源码的位置,创建chromium文件夹并进入,mkdir chromium && cd chromium;
2. fetch chromium;
ps:这里有个问题,我用的Win10带的默认的windows defender是开启的,此时在下载完源码后会出现:
- Traceback (most recent call last):
- File "D:\git\google\depot_tools\gclient_scm.py", line 965, in _Clone
- os.path.join(self.checkout_path, '.git'))
- File "D:\git\google\depot_tools\gclient_utils.py", line 158, in safe_rename
- os.rename(old, new)
- WindowsError: [Error 5]
- [0:22:25] _____ removing non-empty tmp dir D:\google\_gclient_src_byzfvs
- ----------------------------------------
- Traceback (most recent call last):
- File "D:\git\google\depot_tools\gclient.py", line 2378, in <module>
- sys.exit(main(sys.argv[1:]))
- File "D:\git\google\depot_tools\gclient.py", line 2364, in main
- return dispatcher.execute(OptionParser(), argv)
- File "D:\git\google\depot_tools\subcommand.py", line 252, in execute
- return command(parser, args[1:])
- File "D:\git\google\depot_tools\gclient.py", line 2117, in CMDsync
- ret = client.RunOnDeps('update', args)
- File "D:\git\google\depot_tools\gclient.py", line 1568, in RunOnDeps
- work_queue.flush(revision_overrides, command, args, options=self._options)
- File "D:\git\google\depot_tools\gclient_utils.py", line 1112, in run
- self.item.run(*self.args, **self.kwargs)
- File "D:\git\google\depot_tools\gclient.py", line 867, in run
- file_list)
- File "D:\git\google\depot_tools\gclient_scm.py", line 166, in RunCommand
- return getattr(self, command)(options, args, file_list)
- File "D:\git\google\depot_tools\gclient_scm.py", line 450, in update
- self._Clone(revision, url, options)
- File "D:\git\google\depot_tools\gclient_scm.py", line 965, in _Clone
- os.path.join(self.checkout_path, '.git'))
- File "D:\git\google\depot_tools\gclient_utils.py", line 158, in safe_rename
- os.rename(old, new)
- WindowsError: [Error 5]
- Traceback (most recent call last):
- File "D:\git\google\depot_tools\\fetch.py", line 353, in <module>
- sys.exit(main())
- File "D:\git\google\depot_tools\\fetch.py", line 348, in main
- return run(options, spec, root)
- File "D:\git\google\depot_tools\\fetch.py", line 342, in run
- return checkout.init()
- File