我正在尝试使用 GN for Chromium 源代码在我的 Windows 10 笔记本电脑上创建一个构建目录。这就是我所做的:
- 设置
WIN TOOLCHAIN
系统环境变量并将其设置为0 - 附加
C:\src\depot_tools
到我的系统Path
变量 -C:\src\depot_tools\src
是源代码所在的位置 - 下载一个有效的 GN.exe 二进制文件并将其放在与 相同的文件夹中
GN.exe.sha1
,该文件夹位于C:\src\depot_tools\src\buildtools\win
我试着跑gn gen out\Default
,但是这一直被抛出-
gn gen out\Default
Traceback (most recent call last):
File "c:/src/depot_tools/src/build/vs_toolchain.py", line 493, in <module>
sys.exit(main())
File "c:/src/depot_tools/src/build/vs_toolchain.py", line 489, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "c:/src/depot_tools/src/build/vs_toolchain.py", line 312, in CopyDlls
_CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
File "c:/src/depot_tools/src/build/vs_toolchain.py", line 292, in _CopyRuntime
suffix)
File "c:/src/depot_tools/src/build/vs_toolchain.py", line 206, in _CopyUCRTRuntime
_CopyRuntimeImpl(target, source)
File "c:/src/depot_tools/src/build/vs_toolchain.py", line 193, in _CopyRuntimeImpl
shutil.copy2(source, target)
File "C:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shutil.py", line 130, in copy2
copyfile(src, dst)
File "C:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'C:\\Windows\\Sysnative\\msvcp140d.dll'
ERROR at //build/toolchain/win/BUILD.gn:43:3: Script returned non-zero exit code.
exec_script("../../vs_toolchain.py",
^----------
Current dir: c:/src/depot_tools/src/out/Default/
Command: C:/src/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe -- c:/src/depot_tools/src/build/vs_toolchain.py copy_dlls c:/src/depot_tools/src/out/Default Debug x64
Returned 1 and printed out:
Copying C:\Windows\Sysnative\ucrtbase.dll to c:/src/depot_tools/src/out/Default\ucrtbase.dll...
Copying C:\Windows\Sysnative\msvcp140d.dll to c:/src/depot_tools/src/out/Default\msvcp140d.dll...
See //BUILD.gn:69:1: which caused the file to be included.
group("gn_all") {
^----------------