OLD | NEW |
1 # Common Build Tasks | 1 # Common Build Tasks |
2 | 2 |
3 The Chromium build system is a complicated beast of a system, and it is not very | 3 The Chromium build system is a complicated beast of a system, and it is not very |
4 well documented beyond the basics of getting the source and building the | 4 well documented beyond the basics of getting the source and building the |
5 Chromium product. This page has more advanced information about the build | 5 Chromium product. This page has more advanced information about the build |
6 system. | 6 system. |
7 | 7 |
8 If you're new to Chromium development, read the | 8 If you're new to Chromium development, read the |
9 [getting started guides](http://dev.chromium.org/developers/how-tos/get-the-code
). | 9 [getting started guides](http://dev.chromium.org/developers/how-tos/get-the-code
). |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 ## Configuring the Build | 61 ## Configuring the Build |
62 | 62 |
63 ### Environment Variables | 63 ### Environment Variables |
64 | 64 |
65 There are various environment variables that can be passed to the metabuild | 65 There are various environment variables that can be passed to the metabuild |
66 system GYP when generating project files. This is a summary of them: | 66 system GYP when generating project files. This is a summary of them: |
67 | 67 |
68 TODO(andybons): Convert to list. | 68 TODO(andybons): Convert to list. |
69 | 69 |
70 | GYP\_DEFINES | A set of key=value pairs separated by space that will set defau
lt values of variables used in .gyp and .gypi files | | 70 |:-------------|:--------------------------------------------------------------| |
71 |:-------------|:---------------------------------------------------------------
----------------------------------------------------| | 71 | `GYP_DEFINES` | A set of key=value pairs separated by space that will set defa
ult values of variables used in .gyp and .gypi files | |
72 | GYP\_GENERATORS | The specific generator that creates build-system specific fi
les | | 72 | `GYP_GENERATORS` | The specific generator that creates build-system specific f
iles | |
73 | GYP\_GENERATOR\_FLAGS | Flags that are passed down to the tool that generates
the build-system specific files | | 73 | `GYP_GENERATOR_FLAGS` | Flags that are passed down to the tool that generates
the build-system specific files | |
74 | GYP\_GENERATOR\_OUTPUT | The directory that the top-level build output directo
ry is relative to | | 74 | `GYP_GENERATOR_OUTPUT` | The directory that the top-level build output directo
ry is relative to | |
75 | 75 |
76 Note also that GYP uses CPPFLAGS, CFLAGS, and CXXFLAGS when generating ninja | 76 Note also that GYP uses CPPFLAGS, CFLAGS, and CXXFLAGS when generating ninja |
77 files (the values at build time = ninja run time are _not_ used); see | 77 files (the values at build time = ninja run time are _not_ used); see |
78 [gyp/generator/ninja.py](https://code.google.com/p/chromium/codesearch#chromium/
src/tools/gyp/pylib/gyp/generator/ninja.py&q=cxxflags). | 78 [gyp/generator/ninja.py](https://code.google.com/p/chromium/codesearch#chromium/
src/tools/gyp/pylib/gyp/generator/ninja.py&q=cxxflags). |
79 | 79 |
80 ### Variable Files | 80 ### Variable Files |
81 | 81 |
82 If you want to keep a set of variables established, there are a couple of magic | 82 If you want to keep a set of variables established, there are a couple of magic |
83 files that GYP reads: | 83 files that GYP reads: |
84 | 84 |
85 #### chromium.gyp\_env | 85 #### chromium.gyp\_env |
86 | 86 |
87 Next to your top-level `/src/` directory, create a file called | 87 Next to your top-level `/src/` directory, create a file called |
88 `chromium.gyp_env`. This holds a JSON dictionary, with the keys being any of the | 88 `chromium.gyp_env`. This holds a JSON dictionary, with the keys being any of the |
89 above environment variables. For the full list of supported keys, see | 89 above environment variables. For the full list of supported keys, see |
90 [/src/build/gyp_helper.py](/build/gyp_helper.py). | 90 [/src/build/gyp_helper.py](/build/gyp_helper.py). |
91 | 91 |
92 ``` { | 92 ``` |
| 93 { |
93 'variables': { | 94 'variables': { |
94 'mac_strip_release': 0, | 95 'mac_strip_release': 0, |
95 }, 'GYP_DEFINES': | 96 }, 'GYP_DEFINES': |
96 'clang=1 ' 'component=shared_library ' 'dcheck_always_on=1 ' | 97 'clang=1 ' 'component=shared_library ' 'dcheck_always_on=1 ' |
97 } ``` | 98 } |
| 99 ``` |
98 | 100 |
99 #### include.gyp | 101 #### include.gyp |
100 | 102 |
101 Or globally in your home directory, create a file `~/.gyp/include.gypi`. | 103 Or globally in your home directory, create a file `~/.gyp/include.gypi`. |
102 | 104 |
103 #### supplement.gypi | 105 #### supplement.gypi |
104 | 106 |
105 The build system will also include any files named `/src/*/supplement.gypi`, | 107 The build system will also include any files named `/src/*/supplement.gypi`, |
106 which should be in the same format as include.gyp above. | 108 which should be in the same format as include.gyp above. |
107 | 109 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 149 |
148 $ GYP_DEFINES="branding=Chrome buildtype=Official" gclient runhooks | 150 $ GYP_DEFINES="branding=Chrome buildtype=Official" gclient runhooks |
149 | 151 |
150 Then building the `chrome` target will produce the official build. This tip can | 152 Then building the `chrome` target will produce the official build. This tip can |
151 be used in conjunction with changing the output directory, since changing these | 153 be used in conjunction with changing the output directory, since changing these |
152 defines will rebuild the world. | 154 defines will rebuild the world. |
153 | 155 |
154 Also note that some GYP\_DEFINES flags are incompatible with the official build. | 156 Also note that some GYP\_DEFINES flags are incompatible with the official build. |
155 If you get an error when you try to build, try removing all your flags and start | 157 If you get an error when you try to build, try removing all your flags and start |
156 with just the above ones. | 158 with just the above ones. |
OLD | NEW |