0

I tried to compile Chromium with the following commands:

gn gen --ide="vs2019" --winsdk="10.0.19041.685" out/Default

autoninja -C out/Default chrome -j 8

And I get a folder with the project (all.sln) and binaries. When I open a solution project (in VS 2022) and try to start debugging (windows local debugger), Visual Studio doesn't just run the compiled binary, instead calls ninja and try to start program(???) named "common_deps_clang_newlib_x64" and cant find them. If i start without debugging (CTRL+F5), i have a same error. And if i change "common_deps_clang_newlib_x64" to eg. "executable_deps_clang_newlib_x64" i have a same error. How to correctly setup this project?

Screenshot https://i.stack.imgur.com/bH3aq.png

Of course, i can use standard debugging, but here is what is written about it:

Using Visual Studio without Intellisense

It is also possible to debug and develop Chrome in Visual Studio without the overhead of a multi-project solution file. Simply “open” your chrome.exe binary with File->Open->Project/Solution, or from a Visual Studio command prompt like so: devenv /debugexe out\Debug\chrome.exe . Many of Visual Studio's code exploration features will not work in this configuration, but by installing the VsChromium Visual Studio Extension you can get the source code to appear in the solution explorer window along with other useful features such as code search. You can add multiple executables of interest (base_unittests.exe, browser_tests.exe) to your solution with File->Add->Existing Project... and change which one will be debugged by right-clicking on them in Solution Explorer and selecting Set as Startup Project. You can also change their properties, including command line arguments, by right-clicking on them in Solution Explorer and selecting Properties.

And VsChromium does not work with VS 2022

Asesh
  • 3,186
  • 2
  • 21
  • 31
Roderico
  • 11
  • 3

1 Answers1

0

The first command is not required to build Chromium. The all.sln is a very big solution which contains all the Chromium source code. It's not meant for debugging Chromium. It's meant to modify Chromium source code with support for IntelliSense. I would recommend the following approach for debugging Chromium:

  1. Open Visual Studio 20XX command prompt (Where XX is the version of VS)
  2. Navigate to the src folder
  3. Type this: devenv /DebugExe out\YourBuildFolder\chrome.exe
  4. Press F5 to start debugging Chromium

I don't think the Chromium build tools support VS 2022 right now. Last time I checked VS 2019 was the latest version it supported. So I would recommend installing VS 2019 to build Chromium

Asesh
  • 3,186
  • 2
  • 21
  • 31