赞
踩
1.下载chromium代码
git clone --recursive https://github.com/chromium/chromium.git
2.根据下载代码中的DEPS文件招到每个依赖项的位置,用自己的方法或者替代方法下载下来放在指定位置,主要是下面几个网址难搞
- 'android_git': 'https://android.googlesource.com',
- 'aomedia_git': 'https://aomedia.googlesource.com',
- 'boringssl_git': 'https://boringssl.googlesource.com',
- 'chromium_git': 'https://chromium.googlesource.com',
- 'dawn_git': 'https://dawn.googlesource.com',
- 'pdfium_git': 'https://pdfium.googlesource.com',
- 'quiche_git': 'https://quiche.googlesource.com',
- 'skia_git': 'https://skia.googlesource.com',
- 'swiftshader_git': 'https://swiftshader.googlesource.com',
- 'webrtc_git': 'https://webrtc.googlesource.com',
本来就是编译windows,可以不下载安卓的东西,第一个忽略
下载boringssl 放在目录 src/third_party/boringssl/src 中
- mkdir src/third_party/boringssl/
- cd src/third_party/boringssl/
- git clone --recursive https://github.com/google/boringssl src
下载skia 放在src/third_party/skia
- cd src/third_party/
- git clone --recursive https://github.com/google/skia
下载webrtc 放在src/third_party/webrtc
- cd src/third_party
- git clone --recursive https://github.com/ibaoger/webrtc
下边的都一样直接去各个地方下载就行了,没有代理只能这么干费点劲
下载玩这些还不算还要把buildtools build base tools 下载下来,这是编译要用的工具,没有办法只能找个代理去下载,我这里有以前下载的,直接考过去大部分都能用,如果是编译新手还是照着官方的一步一步来
编译遇到的问题
1.最新版的会要求安装debug tools
You must installWindows 10 SDK version 10.0.19041.0 including the "Debugging Tools for Windows" feature.
把这个选上就行
2. LANGUAGE.timestamp
python build\util\lastchange.py build\util\LASTCHANGE
东拼西凑终于可以gn成功了,脚本如下:
- set PATH=D:\WorkStation\webrtcsln\depot_tools;%PATH%
- set GYP_MSVS_VERSION=2019
- set vs2019_install=D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
- set GYP_MSVS_OVERRIDE_PATH=D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
- set GYP_GENERATORS=msvs-ninja,ninja
- set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10
- set DEPOT_TOOLS_WIN_TOOLCHAIN=0
- REM ninja -C out/Default
- gn gen out/Default --ide=vs2019
开始生成执行程序
ninja -C out/Default chrome -d explain
报了一大堆dirty,missing错
,查看了一下错误原来是llvm构建工具链还没有,拷贝了一份以前的src\third_party\llvm-build\Release+Asserts,有些参数不支持了报错
- clang-cl: error: unknown argument ignored in clang-cl: '-fno-delete-null-pointer-checks' [-Werror,-Wunknown-argument]
- clang-cl: error: unknown argument ignored in clang-cl: '-fno-ident' [-Werror,-Wunknown-argument]
- clang-cl: error: unknown argument ignored in clang-cl: '-ffile-compilation-dir=.' [-Werror,-Wunknown-argument]
只能下载相应版本的
python ./src/tools/clang/scripts/update.py
获取工具链地址,正如你所料的肯定是下不下来,让别人替你下载
然后拷贝到src\third_party\llvm-build\Release+Asserts
https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-llvmorg-14-init-3940-gafc45ff0-2.tgz
google做东西,好像什么都是未跨平台考虑的,很多编译构建不方便的地方大不了自己搞一套,反正是不用msys这类的跨平台工具,bazel/ninja/gn用起来挺方便,不过在国内还是cmake比较方便,要是改成cmake就好了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。