Follow all the Get the Code instructions for your target platform up to and including running hooks.
Similarly to Chromium, to build Cronet for development and debugging purposes:
gn
to create ninja files targeting the intended platformninja
to execute the ninja files to run the buildThe two main difference from a Chromium build are:
TODO(crbug.com/40287068): This might change in the future. Remembering the set of gn args to be used for a Cronet build is complicated. So, we rely on //components/cronet/tools/cr_cronet.py
to do that for us.
$ ./components/cronet/tools/cr_cronet.py gn
To better understand how this works, and the configuration paraters it supports, refer to cr_cronet.py
's source code and:
$ ./components/cronet/tools/cr_cronet.py --help
The previous steps generated the files needed to compile Cronet. All that remains now is to find a target to build. This can be done through this command:
$ autoninja -C out/your_cronet_output_directory your_cronet_target
Where, your_cronet_output_directory
is what was set through cr_cronet
and your_cronet_target
is one of of Cronet's target within some BUILD.gn
file.
To build Cronet with optimizations and with debug information stripped out:
$ gn clean out/Release $ ./components/cronet/tools/cr_cronet.py gn --release $ autoninja -C out/Release cronet_package