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?
Asked
Active
Viewed 1,059 times
1

Melab
- 2,594
- 7
- 30
- 51
1 Answers
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 = ...
or cflags += ...
definitions that apply to the compilation units in question. In case of V8, you can e.g. add your flag to the cflags = []
initialization here, or you could make a similar change in build/config/compiler/BUILD.gn
, which will also affect any dependencies.

jmrk
- 34,271
- 7
- 59
- 74
-
Is there an easier way? Perhaps one from the GN method that is intended to provide the functionality I seek without editing "core" configuration files or scripts? – Melab Sep 01 '21 at 00:12
-
I don't think there's another way -- as I said, specifying build configuration via files is an intentional choice that GN has made. (I also think that changing 1 line in 1 file qualifies as "easy".) – jmrk Sep 01 '21 at 10:42