A small number of Chromium developers may be using the
--export-compile-commands switch to GN in their builds. This generates a Clang compilation database normally used for editor integration or Clang refactoring tools.
If this doesn't sound familiar to you, you can ignore this email.
GN is deprecating this switch in favor of a new one --add-export-compile-commands with slightly different semantics. Currently they both work, but I'll remove --export-compile-commands in a few weeks and it will be silently ignored (✻).
The old switch had unusual matching rules where it matched any targets with the "name" (the part after the colon in the label) in any directory and toolchain. The new switch uses GN "label patterns" (see "gn help label_pattern") which is more flexible and matches related syntax in GN. For most users of this flag, you'll just give the normal label of the target you care about. This target and all of its dependencies (recursively) will be included in the compilation database.
Old (matches everything)
gn gen --export-compile-commands out/default
New
gn gen --add-export-compile-commands="*" out/default
Old (matches anything named "chrome")
gn gen --export-compile-commands=chrome out/default
New (matches this particular target which is probably what you wanted)
gn gen --add-export-compile-commands="//chrome" out/default
Old (matches anything named "chrome" and "browser_tests")
gn gen --export-compile-commands=chrome,browser_tests out/default
New (specify multiple labels with multiple switches)
gn gen --add-export-compile-commands="//chrome" --add-export-compile-commands=//chrome/test:browser_tests out/default
You can also just edit the GN command-line without re-invoking GN manually by editing out/default/build.ninja. The command line is " command = ..." on line 4 of the file.
Brett
(✻) The silent ignore is due to a long story migrating Fuchsia's use of this flag. Sorry for the inconvenience.