The build system that V8 uses is not straightforward. Assume I desired to add -save-temps to the build flags to keep all intermediate files produced during compilation. Where would I specify this information? Do you specify it in a particular command? Does it have to be added to a special build configuration file?
Compile GN-based projects with modified compiler flags
1.4k views Asked by Melab At
1
(This question isn't really about V8, but rather the GN build system.)
GN is intentionally designed to take all build configuration from files (which you can check into git/etc for reproducible builds), rather than command-line flags and environment variables. So any extra compiler flags also have to be specified via files. Specifically, you can edit any of the
cflags = ...orcflags += ...definitions that apply to the compilation units in question. In case of V8, you can e.g. add your flag to thecflags = []initialization here, or you could make a similar change inbuild/config/compiler/BUILD.gn, which will also affect any dependencies.