1:下载CLion 2021.1.3
2:选择File->Open 导入chromium源码
3:在Src同级目录新建一个CMakeLists.txt
4:点击clion编译按钮左边Edit Config按钮
5:添加Build Target,Building, Debugging target
5.1:点击configure custom buildtargets
5.2:Name:随意,ToolChain:随意,Clean:随意,Build:点击旁边"..."按钮
5.3:点添加按钮
Program:ninja所在的目录
Arguments:-C out/Default chrome -j 10
Working directory:depot_tools所在目录
6:添加Custom Build Application
6.1:Name:随意,Target:选择第5步创建的Target,Executable:随意,Program arguments:--no-sanbox --no-zygote --single-process https://www.chromium.org,
最后点击ok就可以编译了!
7:附上成功调试的界面