我想调试chrome代码,以检查它是如何编译javascript代码的。我已经下载了chromium代码,并试图使用visualstudio构建cef解决方案文件,但我得到了以下错误:
错误LNK1112:模块计算机类型"x64"与目标计算机类型"X86"冲突\third_party\libjpeg_turbo\jccols2-64.obj cefclient
错误MSB3073:命令">调用ninja.exe-C..\out\Debug\cefclient"已退出,代码为1。D: \ Ishan\铬\铬\ src\ cef \ cefclient.vcxproj cefclient
有人能帮我解决这个错误吗
谢谢Ishan jain
Chromium只能在64位Windows上构建,如果您在64位上构建32位也没关系。必须使用Windows 7 x64或更高版本
您似乎已将构建配置为64位(如果您使用的是忍者,则很可能使用SET GYP_DEFINES=target_arch=x64),但您构建的是32位,很可能使用
忍者-C-out\Debug。因此,您似乎已经配置了一个64位构建,但您正在构建32位
64位版本在Debug_64中(或Debug_64,我现在不记得了)。因此:
-如果您配置了target_arch=x64,则使用ninja-C out\Debugx64
构建-如果您配置的target_arch=ia32(或者为空,我认为Windows上的默认构建为32位),则使用ninja-C out \Debug构建
AFAIK你不能在同一个目录中构建——但也许我错了——32和64都是构建的(主要是因为生成了ninja文件)。如果您正在使用SET GYP_GENERATORS=msvs ninja,ninja(主要是在生成Visual Studio解决方案时),它可能会起作用,但msvs nin贾不受支持,也不再维护。
编辑:从Visual Studio构建的ninja示例
VS外部工具>添加一个条目,如:
标题构建libcef调试
命令F:\dev\CEF\2357\build.bat
(F:\dev/CEF\2357\x86\chrome中的源代码)
参数调试
初始目录F:\dev\CEF\2357
我的布局是这样的(构建分支是2357):
F:\dev\CEF\23.57根目录
/
nbsp;自动化git.py
nbsp build.bat
x86/
nbsp chrome/
build.bat是下面的文件;x86/目录是手动创建的。在x86下,我可以检查铬(cef和depot_tools也将出现在x86/下)
我的build.bat文件是这样的(详细信息可以很容易地找到):
@echo off
:: set env vars affecting CEF build
SET GYP_GENERATORS=msvs-ninja,ninja
SET GYP_MSVS_VERSION=2013
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
SET GYP_DEFINES=target_arch=ia32
SET DEPOT_TOOLS=F:devCEF2357x86depot_tools
SET PATH=%DEPOT_TOOLS%;%PATH%
set ROOTDIST=F:devCEF2357x86.deploy
set BUILDOUT=F:devCEF2357x86chromiumsrcout
set REDIST=F:devCEF2357x86chromiumsrcceftoolsdistribwin
set CEFDIST=3.43.0.2357.18.20150512
:: change to directory if not already there
PUSHD
set CURDIR=%CD%
@echo Current directory is %CURDIR%
if [%CURDIR%] EQU [F:devCEF2357] goto l_config
F:
cd F:devCEF2357
set CURDIR=%CD%
@echo Current directory changed to %CURDIR%
:l_config
F:devCEF2357automate-git.py --download-dir=F:devCEF2357x86 --branch=2357 --no-update
goto l_build
:l_build
cd x86chromiumsrc
if [%1%] EQU [all] goto l_build_all
if [%1%] EQU [debug] goto l_build_dbg
if [%1%] EQU [release] goto l_build_rel
if [%1%] EQU [distrib] goto l_build_distrib
if [%1%] EQU [distclean] goto l_build_distclean
if [%1%] EQU [clean] goto l_build_clean
goto l_error
:l_build_all
@echo Building libcef branch 2357 Debug.
ninja -C outDebug cefclient
@echo Building libcef branch 2357 Release.
ninja -C outRelease cefclient
@echo Build libcef Debug,Release branch 2357 finished.
goto l_build_distclean
:l_build_dbg
@echo Building libcef branch 2357 Debug.
ninja -C outDebug cefclient
@echo Build libcef Debug branch 2357 finished.
goto l_end
:l_build_rel
@echo Building libcef branch 2357 Release.
ninja -C outRelease cefclient
@echo Build libcef Release branch 2357 finished.
goto l_end
:l_build_clean
@echo Cleaning build libcef branch 2357.
ninja -C outDebug -t clean cefclient
ninja -C outRelease -t clean cefclient
@echo Clean libcef branch 2357 finished.
goto l_end
:l_build_distclean
@echo Clean libcef branch 2357 %CEFDIST% distribution.
rmdir /s /q %ROOTDIST%%CEFDIST%
goto l_build_distrib
:l_build_distrib
@echo Make libcef branch 2357 %CEFDIST% distribution.
@echo Deploy directory: %ROOTDIST%%CEFDIST%
:: /.patch
:: /include
:: /base
:: /internal
:: /capi
:: /internal
:: /wrapper
:: /lib
:: /Win32
:: /Debug
:: /lib
:: /locales
:: /Release
:: /lib
:: /locales
::
:: ensure target path
mkdir %ROOTDIST%%CEFDIST%
mkdir %ROOTDIST%%CEFDIST%include
mkdir %ROOTDIST%%CEFDIST%lib
mkdir %ROOTDIST%%CEFDIST%libWin32
mkdir %ROOTDIST%%CEFDIST%libWin32Debug
mkdir %ROOTDIST%%CEFDIST%libWin32Debuglib
mkdir %ROOTDIST%%CEFDIST%libWin32Release
mkdir %ROOTDIST%%CEFDIST%libWin32Releaselib
:: include files
xcopy f:devCEF2357x86chromiumsrccefinclude %ROOTDIST%%CEFDIST%include /S /E /Y /I
:: bdCefVer.h
copy /Y f:devCEF2357x86chromiumsrccefbdCefVer.h %ROOTDIST%%CEFDIST%bdCefVer.h
:: Debug
:: locales
xcopy %BUILDOUT%Debuglocales %ROOTDIST%%CEFDIST%libWin32Debuglocales /S /E /Y /I
:: lib
copy /Y %BUILDOUT%Debuglibcef.dll.lib %ROOTDIST%%CEFDIST%libWin32Debugliblibcef.dll.lib
copy /Y %BUILDOUT%DebuglibEGL.dll.lib %ROOTDIST%%CEFDIST%libWin32DebugliblibEGL.dll.lib
copy /Y %BUILDOUT%DebuglibGLESv2.dll.lib %ROOTDIST%%CEFDIST%libWin32DebugliblibGLESv2.dll.lib
copy /Y %BUILDOUT%Debugffmpegsumo.dll.lib %ROOTDIST%%CEFDIST%libWin32Debuglibffmpegsumo.dll.lib
copy /Y %BUILDOUT%Debugobjcefcef_sandbox.lib %ROOTDIST%%CEFDIST%libWin32Debuglibcef_sandbox.lib
copy /Y %BUILDOUT%Debugobjceflibcef_dll_wrapper.lib %ROOTDIST%%CEFDIST%libWin32Debugliblibcef_dll_wrapper.lib
copy /Y %BUILDOUT%Debugobjceflibcef_static.lib %ROOTDIST%%CEFDIST%libWin32Debugliblibcef_static.lib
:: binaries, paks, redistributables
copy /Y %BUILDOUT%Debugnatives_blob.bin %ROOTDIST%%CEFDIST%libWin32Debugnatives_blob.bin
copy /Y %BUILDOUT%Debugsnapshot_blob.bin %ROOTDIST%%CEFDIST%libWin32Debugsnapshot_blob.bin
copy /Y %BUILDOUT%Debugicudtl.dat %ROOTDIST%%CEFDIST%libWin32Debugicudtl.dat
:: copy /Y %REDIST%d3dcompiler_43.dll %ROOTDIST%%CEFDIST%libWin32Debugd3dcompiler_43.dll
copy /Y %BUILDOUT%Debugd3dcompiler_47.dll %ROOTDIST%%CEFDIST%libWin32Debugd3dcompiler_47.dll
copy /Y %BUILDOUT%Debugffmpegsumo.dll %ROOTDIST%%CEFDIST%libWin32Debugffmpegsumo.dll
copy /Y %BUILDOUT%Debugffmpegsumo.dll.pdb %ROOTDIST%%CEFDIST%libWin32Debugffmpegsumo.dll.pdb
copy /Y %BUILDOUT%Debuglibcef.dll %ROOTDIST%%CEFDIST%libWin32Debuglibcef.dll
copy /Y %BUILDOUT%Debuglibcef.dll.pdb %ROOTDIST%%CEFDIST%libWin32Debuglibcef.dll.pdb
copy /Y %BUILDOUT%DebuglibEGL.dll %ROOTDIST%%CEFDIST%libWin32DebuglibEGL.dll
copy /Y %BUILDOUT%DebuglibEGL.dll.pdb %ROOTDIST%%CEFDIST%libWin32DebuglibEGL.dll.pdb
copy /Y %BUILDOUT%DebuglibGLESv2.dll %ROOTDIST%%CEFDIST%libWin32DebuglibGLESv2.dll
copy /Y %BUILDOUT%DebuglibGLESv2.dll.pdb %ROOTDIST%%CEFDIST%libWin32DebuglibGLESv2.dll.pdb
copy /Y %BUILDOUT%Debugcefclient.exe %ROOTDIST%%CEFDIST%libWin32Debugcefclient.exe
copy /Y %BUILDOUT%Debugwow_helper.exe %ROOTDIST%%CEFDIST%libWin32Debugwow_helper.exe
copy /Y %BUILDOUT%Debugwow_helper.pdb %ROOTDIST%%CEFDIST%libWin32Debugwow_helper.pdb
copy /Y %BUILDOUT%Debugcef.pak %ROOTDIST%%CEFDIST%libWin32Debugcef.pak
copy /Y %BUILDOUT%Debugcef_100_percent.pak %ROOTDIST%%CEFDIST%libWin32Debugcef_100_percent.pak
copy /Y %BUILDOUT%Debugcef_200_percent.pak %ROOTDIST%%CEFDIST%libWin32Debugcef_200_percent.pak
copy /Y %BUILDOUT%Debugdevtools_resources.pak %ROOTDIST%%CEFDIST%libWin32Debugdevtools_resources.pak
:: Release
:: locales
xcopy %BUILDOUT%Releaselocales %ROOTDIST%%CEFDIST%libWin32Releaselocales /S /E /Y /I /F
:: lib
copy /Y %BUILDOUT%Releaselibcef.dll.lib %ROOTDIST%%CEFDIST%libWin32Releaseliblibcef.dll.lib
copy /Y %BUILDOUT%ReleaselibEGL.dll.lib %ROOTDIST%%CEFDIST%libWin32ReleaseliblibEGL.dll.lib
copy /Y %BUILDOUT%ReleaselibGLESv2.dll.lib %ROOTDIST%%CEFDIST%libWin32ReleaseliblibGLESv2.dll.lib
copy /Y %BUILDOUT%Releaseffmpegsumo.dll.lib %ROOTDIST%%CEFDIST%libWin32Releaselibffmpegsumo.dll.lib
copy /Y %BUILDOUT%Releaseobjceflibcef_dll_wrapper.lib %ROOTDIST%%CEFDIST%libWin32Releaseliblibcef_dll_wrapper.lib
copy /Y %BUILDOUT%Releaseobjceflibcef_static.lib %ROOTDIST%%CEFDIST%libWin32Releaseliblibcef_static.lib
copy /Y %BUILDOUT%Releaseobjcefcef_sandbox.lib %ROOTDIST%%CEFDIST%libWin32Releaselibcef_sandbox.lib
:: binaries, paks, redistributables
copy /Y %BUILDOUT%Releasenatives_blob.bin %ROOTDIST%%CEFDIST%libWin32Releasenatives_blob.bin
copy /Y %BUILDOUT%Releasesnapshot_blob.bin %ROOTDIST%%CEFDIST%libWin32Releasesnapshot_blob.bin
copy /Y %BUILDOUT%Releaseicudtl.dat %ROOTDIST%%CEFDIST%libWin32Releaseicudtl.dat
:: copy /Y %REDIST%d3dcompiler_43.dll %ROOTDIST%%CEFDIST%libWin32Released3dcompiler_43.dll
copy /Y %BUILDOUT%Released3dcompiler_47.dll %ROOTDIST%%CEFDIST%libWin32Released3dcompiler_47.dll
copy /Y %BUILDOUT%Releaseffmpegsumo.dll %ROOTDIST%%CEFDIST%libWin32Releaseffmpegsumo.dll
copy /Y %BUILDOUT%Releaseffmpegsumo.dll.pdb %ROOTDIST%%CEFDIST%libWin32Releaseffmpegsumo.dll.pdb
copy /Y %BUILDOUT%Releaselibcef.dll %ROOTDIST%%CEFDIST%libWin32Releaselibcef.dll
copy /Y %BUILDOUT%Releaselibcef.dll.pdb %ROOTDIST%%CEFDIST%libWin32Releaselibcef.dll.pdb
copy /Y %BUILDOUT%ReleaselibEGL.dll %ROOTDIST%%CEFDIST%libWin32ReleaselibEGL.dll
copy /Y %BUILDOUT%ReleaselibEGL.dll.pdb %ROOTDIST%%CEFDIST%libWin32ReleaselibEGL.dll.pdb
copy /Y %BUILDOUT%ReleaselibGLESv2.dll %ROOTDIST%%CEFDIST%libWin32ReleaselibGLESv2.dll
copy /Y %BUILDOUT%ReleaselibGLESv2.dll.pdb %ROOTDIST%%CEFDIST%libWin32ReleaselibGLESv2.dll.pdb
copy /Y %BUILDOUT%Releasecefclient.exe %ROOTDIST%%CEFDIST%libWin32Releasecefclient.exe
copy /Y %BUILDOUT%Releasewow_helper.exe %ROOTDIST%%CEFDIST%libWin32Releasewow_helper.exe
copy /Y %BUILDOUT%Releasewow_helper.pdb %ROOTDIST%%CEFDIST%libWin32Releasewow_helper.pdb
copy /Y %BUILDOUT%Releasecef.pak %ROOTDIST%%CEFDIST%libWin32Releasecef.pak
copy /Y %BUILDOUT%Releasecef_100_percent.pak %ROOTDIST%%CEFDIST%libWin32Releasecef_100_percent.pak
copy /Y %BUILDOUT%Releasecef_200_percent.pak %ROOTDIST%%CEFDIST%libWin32Releasecef_200_percent.pak
copy /Y %BUILDOUT%Releasedevtools_resources.pak %ROOTDIST%%CEFDIST%libWin32Releasedevtools_resources.pak
copy /Y %REDIST%README.redistrib.txt %ROOTDIST%%CEFDIST%README.redistrib.txt
@echo Making distribution libcef Debug,Release branch 2357 finished.
goto l_end
:l_error
@echo Invalid or missing option.
goto l_end
:l_end
F:
cd F:devCEF2357
POPD
您运行的是64位Windows吗?这个文件让人觉得你只能在64位操作系统上构建64位。如果你是,它可能仍然有帮助-你可以看到他们是如何确定主机和目标的。
https://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/base/build_config.h?r=24402