OLD | NEW |
---|---|
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 if (target_os == "") { | 5 if (target_os == "") { |
6 target_os = host_os | 6 target_os = host_os |
7 } | 7 } |
8 | 8 |
9 if (target_cpu == "") { | 9 if (target_cpu == "") { |
10 if (target_os == "android") { | 10 if (target_os == "android") { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 # -1 means auto-set (off in release, regular in debug). | 87 # -1 means auto-set (off in release, regular in debug). |
88 symbol_level = -1 | 88 symbol_level = -1 |
89 | 89 |
90 # Component build. | 90 # Component build. |
91 is_component_build = false | 91 is_component_build = false |
92 | 92 |
93 # Debug build. | 93 # Debug build. |
94 is_debug = true | 94 is_debug = true |
95 | 95 |
96 # Whether we're a traditional desktop unix. | 96 # Whether we're a traditional desktop unix. |
97 is_desktop_linux = current_os == "linux" && current_os != "chromeos" | 97 is_desktop_linux = current_os == "linux" |
viettrungluu
2016/01/12 22:47:11
We should probably get rid of "is_desktop_linux" i
Petr Hosek
2016/01/13 00:35:54
I'll do that in a separate change.
| |
98 | 98 |
99 # Set to true when compiling with the Clang compiler. Typically this is used | 99 # Set to true when compiling with the Clang compiler. Typically this is used |
100 # to configure warnings. | 100 # to configure warnings. |
101 is_clang = current_os == "mac" || current_os == "ios" || | 101 is_clang = current_os == "mac" || current_os == "ios" || current_os == "linux" |
102 current_os == "linux" || current_os == "chromeos" | |
103 | 102 |
104 # By default, assume a non-PNaCl toolchain. | 103 # By default, assume a non-PNaCl toolchain. |
105 is_pnacl = false | 104 is_pnacl = false |
106 | 105 |
107 # Selects the desired build flavor. Official builds get additional | 106 # Selects the desired build flavor. Official builds get additional |
108 # processing to prepare for release. Normally you will want to develop and | 107 # processing to prepare for release. Normally you will want to develop and |
109 # test with this flag off. | 108 # test with this flag off. |
110 # TODO(brettw) move to chrome_build.gni when DEPS are updated. | 109 # TODO(brettw) move to chrome_build.gni when DEPS are updated. |
111 is_official_build = false | 110 is_official_build = false |
112 | 111 |
113 # Select the desired branding flavor. False means normal Chromium branding, | 112 # Select the desired branding flavor. False means normal Chromium branding, |
114 # true means official Google Chrome branding (requires extra Google-internal | 113 # true means official Google Chrome branding (requires extra Google-internal |
115 # resources). | 114 # resources). |
116 # TODO(brettw) move to chrome_build.gni when DEPS are updated. | 115 # TODO(brettw) move to chrome_build.gni when DEPS are updated. |
117 is_chrome_branded = false | 116 is_chrome_branded = false |
118 | 117 |
119 # Compile for Address Sanitizer to find memory bugs. | 118 # Compile for Address Sanitizer to find memory bugs. |
120 is_asan = false | 119 is_asan = false |
121 | 120 |
122 # Compile for Leak Sanitizer to find leaks. | 121 # Compile for Leak Sanitizer to find leaks. |
123 is_lsan = false | 122 is_lsan = false |
124 | 123 |
125 # Compile for Memory Sanitizer to find uninitialized reads. | 124 # Compile for Memory Sanitizer to find uninitialized reads. |
126 is_msan = false | 125 is_msan = false |
127 | 126 |
128 # Compile for Thread Sanitizer to find threading bugs. | 127 # Compile for Thread Sanitizer to find threading bugs. |
129 is_tsan = false | 128 is_tsan = false |
130 | 129 |
131 if (current_os == "chromeos") { | |
132 # Allows the target toolchain to be injected as arguments. This is needed | |
133 # to support the CrOS build system which supports per-build-configuration | |
134 # toolchains. | |
135 cros_use_custom_toolchain = false | |
136 } | |
137 | |
138 # DON'T ADD MORE FLAGS HERE. Read the comment above. | 130 # DON'T ADD MORE FLAGS HERE. Read the comment above. |
139 } | 131 } |
140 | 132 |
141 # ============================================================================= | 133 # ============================================================================= |
142 # OS DEFINITIONS | 134 # OS DEFINITIONS |
143 # ============================================================================= | 135 # ============================================================================= |
144 # | 136 # |
145 # We set these various is_FOO booleans for convenience in writing OS-based | 137 # We set these various is_FOO booleans for convenience in writing OS-based |
146 # conditions. | 138 # conditions. |
147 # | 139 # |
148 # - is_android, is_chromeos, is_ios, and is_win should be obvious. | 140 # - is_android, is_ios, and is_win should be obvious. |
149 # - is_mac is set only for desktop Mac. It is not set on iOS. | 141 # - is_mac is set only for desktop Mac. It is not set on iOS. |
150 # - is_posix is true for mac and any Unix-like system (basically everything | 142 # - is_posix is true for mac and any Unix-like system (basically everything |
151 # except Windows). | 143 # except Windows). |
152 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is | 144 # - is_linux is true for desktop Linux, but not Android (which is |
153 # generally too different despite being based on the Linux kernel). | 145 # generally too different despite being based on the Linux kernel). |
154 # | 146 # |
155 # Do not add more is_* variants here for random lesser-used Unix systems like | 147 # Do not add more is_* variants here for random lesser-used Unix systems like |
156 # aix or one of the BSDs. If you need to check these, just check the | 148 # aix or one of the BSDs. If you need to check these, just check the |
157 # current_os value directly. | 149 # current_os value directly. |
158 | 150 |
159 if (current_os == "mac") { | 151 if (current_os == "mac") { |
160 is_android = false | 152 is_android = false |
161 is_chromeos = false | 153 is_chromeos = false |
162 is_fnl = false | 154 is_fnl = false |
163 is_ios = false | 155 is_ios = false |
164 is_linux = false | 156 is_linux = false |
165 is_mac = true | 157 is_mac = true |
166 is_nacl = false | 158 is_nacl = false |
167 is_posix = true | 159 is_posix = true |
168 is_win = false | 160 is_win = false |
169 } else if (current_os == "android") { | 161 } else if (current_os == "android") { |
170 is_android = true | 162 is_android = true |
171 is_chromeos = false | 163 is_chromeos = false |
172 is_fnl = false | 164 is_fnl = false |
173 is_ios = false | 165 is_ios = false |
174 is_linux = false | 166 is_linux = false |
175 is_mac = false | 167 is_mac = false |
176 is_nacl = false | 168 is_nacl = false |
177 is_posix = true | 169 is_posix = true |
178 is_win = false | 170 is_win = false |
179 } else if (current_os == "chromeos") { | |
180 is_android = false | |
181 is_chromeos = true | |
182 is_fnl = false | |
183 is_ios = false | |
184 is_linux = true | |
185 is_mac = false | |
186 is_nacl = false | |
187 is_posix = true | |
188 is_win = false | |
189 } else if (current_os == "nacl") { | 171 } else if (current_os == "nacl") { |
190 # current_os == "nacl" will be passed by the nacl toolchain definition. | 172 # current_os == "nacl" will be passed by the nacl toolchain definition. |
191 # It is not set by default or on the command line. We treat is as a | 173 # It is not set by default or on the command line. We treat is as a |
192 # Posix variant. | 174 # Posix variant. |
193 is_android = false | 175 is_android = false |
194 is_chromeos = false | 176 is_chromeos = false |
195 is_fnl = false | 177 is_fnl = false |
196 is_ios = false | 178 is_ios = false |
197 is_linux = false | 179 is_linux = false |
198 is_mac = false | 180 is_mac = false |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 } | 532 } |
551 set_default_toolchain("//build/toolchain/android:$current_cpu") | 533 set_default_toolchain("//build/toolchain/android:$current_cpu") |
552 } else if (is_linux) { | 534 } else if (is_linux) { |
553 if (is_clang) { | 535 if (is_clang) { |
554 host_toolchain = "//build/toolchain/linux:clang_$host_cpu" | 536 host_toolchain = "//build/toolchain/linux:clang_$host_cpu" |
555 set_default_toolchain("//build/toolchain/linux:clang_$current_cpu") | 537 set_default_toolchain("//build/toolchain/linux:clang_$current_cpu") |
556 } else { | 538 } else { |
557 host_toolchain = "//build/toolchain/linux:$host_cpu" | 539 host_toolchain = "//build/toolchain/linux:$host_cpu" |
558 set_default_toolchain("//build/toolchain/linux:$current_cpu") | 540 set_default_toolchain("//build/toolchain/linux:$current_cpu") |
559 } | 541 } |
560 if (is_chromeos && cros_use_custom_toolchain) { | |
561 set_default_toolchain("//build/toolchain/cros:target") | |
562 } | |
563 if (is_fnl) { | 542 if (is_fnl) { |
564 set_default_toolchain("//build/toolchain/fnl:target") | 543 set_default_toolchain("//build/toolchain/fnl:target") |
565 } | 544 } |
566 } else if (is_mac) { | 545 } else if (is_mac) { |
567 host_toolchain = "//build/toolchain/mac:clang_x64" | 546 host_toolchain = "//build/toolchain/mac:clang_x64" |
568 set_default_toolchain(host_toolchain) | 547 set_default_toolchain(host_toolchain) |
569 } else if (is_ios) { | 548 } else if (is_ios) { |
570 host_toolchain = "//build/toolchain/mac:clang_x64" | 549 host_toolchain = "//build/toolchain/mac:clang_x64" |
571 set_default_toolchain("//build/toolchain/mac:clang_$current_cpu") | 550 set_default_toolchain("//build/toolchain/mac:clang_$current_cpu") |
572 } else if (is_nacl) { | 551 } else if (is_nacl) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 } | 750 } |
772 if (defined(invoker.testonly)) { | 751 if (defined(invoker.testonly)) { |
773 testonly = invoker.testonly | 752 testonly = invoker.testonly |
774 } | 753 } |
775 if (defined(invoker.visibility)) { | 754 if (defined(invoker.visibility)) { |
776 visibility = invoker.visibility | 755 visibility = invoker.visibility |
777 } | 756 } |
778 } | 757 } |
779 } | 758 } |
780 } | 759 } |
OLD | NEW |