| 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 # ============================================================================= | 5 # ============================================================================= |
| 6 # PLATFORM SELECTION | 6 # PLATFORM SELECTION |
| 7 # ============================================================================= | 7 # ============================================================================= |
| 8 # | 8 # |
| 9 # There are two main things to set: "os" and "cpu". The "toolchain" is the name | 9 # There are two main things to set: "os" and "cpu". The "toolchain" is the name |
| 10 # of the GN thing that encodes combinations of these things. | 10 # of the GN thing that encodes combinations of these things. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 # 0 means no symbols. | 118 # 0 means no symbols. |
| 119 # -1 means auto-set (off in release, regular in debug). | 119 # -1 means auto-set (off in release, regular in debug). |
| 120 symbol_level = -1 | 120 symbol_level = -1 |
| 121 | 121 |
| 122 # Component build. | 122 # Component build. |
| 123 is_component_build = false | 123 is_component_build = false |
| 124 | 124 |
| 125 # Debug build. | 125 # Debug build. |
| 126 is_debug = true | 126 is_debug = true |
| 127 | 127 |
| 128 # Whether we're building components and interfaces for ChromeOS |
| 129 # This is for backwards compatability until the rename in complete in all |
| 130 # dependent files. See use_cros_fe in features.gni. They should be the same. |
| 131 # TODO(petermayo): Remove this when it doesn't break known compiles. |
| 132 is_chromeos = current_os == "chromeos" |
| 133 |
| 128 # Whether we're a traditional desktop unix. | 134 # Whether we're a traditional desktop unix. |
| 129 is_desktop_linux = current_os == "linux" && current_os != "chromeos" | 135 is_desktop_linux = current_os == "linux" && !is_chromeos |
| 130 | 136 |
| 131 # Set to true when compiling with the Clang compiler. Typically this is used | 137 # Set to true when compiling with the Clang compiler. Typically this is used |
| 132 # to configure warnings. | 138 # to configure warnings. |
| 133 is_clang = current_os == "mac" || current_os == "ios" || | 139 is_clang = current_os == "mac" || current_os == "ios" || |
| 134 current_os == "linux" || current_os == "chromeos" | 140 current_os == "linux" || current_os == "chromeos" |
| 135 | 141 |
| 136 # Compile for Address Sanitizer to find memory bugs. | 142 # Compile for Address Sanitizer to find memory bugs. |
| 137 is_asan = false | 143 is_asan = false |
| 138 | 144 |
| 139 # Compile for Leak Sanitizer to find leaks. | 145 # Compile for Leak Sanitizer to find leaks. |
| 140 is_lsan = false | 146 is_lsan = false |
| 141 | 147 |
| 142 # Compile for Memory Sanitizer to find uninitialized reads. | 148 # Compile for Memory Sanitizer to find uninitialized reads. |
| 143 is_msan = false | 149 is_msan = false |
| 144 | 150 |
| 145 # Compile for Thread Sanitizer to find threading bugs. | 151 # Compile for Thread Sanitizer to find threading bugs. |
| 146 is_tsan = false | 152 is_tsan = false |
| 147 | 153 |
| 148 if (current_os == "chromeos") { | 154 if (current_os == "chromeos") { |
| 149 # Allows the target toolchain to be injected as arguments. This is needed | 155 # Allows the target toolchain to be injected as arguments. This is needed |
| 150 # to support the CrOS build system which supports per-build-configuration | 156 # to support the CrOS build system which supports per-build-configuration |
| 151 # toolchains. | 157 # toolchains. |
| 152 cros_use_custom_toolchain = false | 158 cros_use_custom_toolchain = false |
| 159 } else { |
| 160 cros_use_custom_toolchain = false |
| 153 } | 161 } |
| 154 | 162 |
| 155 # DON'T ADD MORE FLAGS HERE. Read the comment above. | 163 # DON'T ADD MORE FLAGS HERE. Read the comment above. |
| 156 } | 164 } |
| 157 | 165 |
| 158 # ============================================================================= | 166 # ============================================================================= |
| 159 # OS DEFINITIONS | 167 # OS DEFINITIONS |
| 160 # ============================================================================= | 168 # ============================================================================= |
| 161 # | 169 # |
| 162 # We set these various is_FOO booleans for convenience in writing OS-based | 170 # We set these various is_FOO booleans for convenience in writing OS-based |
| 163 # conditions. | 171 # conditions. |
| 164 # | 172 # |
| 165 # - is_android, is_chromeos, is_ios, and is_win should be obvious. | 173 # - is_android, is_ios, and is_win should be obvious. |
| 166 # - is_mac is set only for desktop Mac. It is not set on iOS. | 174 # - is_mac is set only for desktop Mac. It is not set on iOS. |
| 167 # - is_posix is true for mac and any Unix-like system (basically everything | 175 # - is_posix is true for mac and any Unix-like system (basically everything |
| 168 # except Windows). | 176 # except Windows). |
| 169 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is | 177 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is |
| 170 # generally too different despite being based on the Linux kernel). | 178 # generally too different despite being based on the Linux kernel). |
| 179 # - is_chromeos_os is true if the results are expected to run on a ChromeOS |
| 180 # machine, using the filesystem and runtime libraries specifed by |
| 181 # a build of that OS, rather than local linux. E.g. presume an update |
| 182 # system, journalled files system, storage modes, no other apps, etc. |
| 171 # | 183 # |
| 172 # Do not add more is_* variants here for random lesser-used Unix systems like | 184 # Do not add more is_* variants here for random lesser-used Unix systems like |
| 173 # aix or one of the BSDs. If you need to check these, just check the | 185 # aix or one of the BSDs. If you need to check these, just check the |
| 174 # current_os value directly. | 186 # current_os value directly. |
| 175 | 187 |
| 176 if (current_os == "win" || current_os == "winrt_81" || | 188 if (current_os == "win" || current_os == "winrt_81" || |
| 177 current_os == "winrt_81_phone" || current_os == "winrt_10") { | 189 current_os == "winrt_81_phone" || current_os == "winrt_10") { |
| 178 is_android = false | 190 is_android = false |
| 179 is_chromeos = false | 191 is_chromeos_os = false |
| 180 is_ios = false | 192 is_ios = false |
| 181 is_linux = false | 193 is_linux = false |
| 182 is_mac = false | 194 is_mac = false |
| 183 is_nacl = false | 195 is_nacl = false |
| 184 is_posix = false | 196 is_posix = false |
| 185 is_win = true | 197 is_win = true |
| 186 } else if (current_os == "mac") { | 198 } else if (current_os == "mac") { |
| 187 is_android = false | 199 is_android = false |
| 188 is_chromeos = false | 200 is_chromeos_os = false |
| 189 is_ios = false | 201 is_ios = false |
| 190 is_linux = false | 202 is_linux = false |
| 191 is_mac = true | 203 is_mac = true |
| 192 is_nacl = false | 204 is_nacl = false |
| 193 is_posix = true | 205 is_posix = true |
| 194 is_win = false | 206 is_win = false |
| 195 } else if (current_os == "android") { | 207 } else if (current_os == "android") { |
| 196 is_android = true | 208 is_android = true |
| 197 is_chromeos = false | 209 is_chromeos_os = false |
| 198 is_ios = false | 210 is_ios = false |
| 199 is_linux = false | 211 is_linux = false |
| 200 is_mac = false | 212 is_mac = false |
| 201 is_nacl = false | 213 is_nacl = false |
| 202 is_posix = true | 214 is_posix = true |
| 203 is_win = false | 215 is_win = false |
| 204 } else if (current_os == "chromeos") { | 216 } else if (current_os == "chromeos") { |
| 205 is_android = false | 217 is_android = false |
| 206 is_chromeos = true | 218 assert(is_chromeos, "ChromiumOS requires is_chromeos.") |
| 219 is_chromeos_os = true |
| 207 is_ios = false | 220 is_ios = false |
| 208 is_linux = true | 221 is_linux = true |
| 209 is_mac = false | 222 is_mac = false |
| 210 is_nacl = false | 223 is_nacl = false |
| 211 is_posix = true | 224 is_posix = true |
| 212 is_win = false | 225 is_win = false |
| 213 } else if (current_os == "nacl") { | 226 } else if (current_os == "nacl") { |
| 214 # current_os == "nacl" will be passed by the nacl toolchain definition. | 227 # current_os == "nacl" will be passed by the nacl toolchain definition. |
| 215 # It is not set by default or on the command line. We treat is as a | 228 # It is not set by default or on the command line. We treat is as a |
| 216 # Posix variant. | 229 # Posix variant. |
| 217 is_android = false | 230 is_android = false |
| 218 is_chromeos = false | 231 is_chromeos_os = false |
| 219 is_ios = false | 232 is_ios = false |
| 220 is_linux = false | 233 is_linux = false |
| 221 is_mac = false | 234 is_mac = false |
| 222 is_nacl = true | 235 is_nacl = true |
| 223 is_posix = true | 236 is_posix = true |
| 224 is_win = false | 237 is_win = false |
| 225 } else if (current_os == "ios") { | 238 } else if (current_os == "ios") { |
| 226 is_android = false | 239 is_android = false |
| 227 is_chromeos = false | 240 is_chromeos_os = false |
| 228 is_ios = true | 241 is_ios = true |
| 229 is_linux = false | 242 is_linux = false |
| 230 is_mac = false | 243 is_mac = false |
| 231 is_nacl = false | 244 is_nacl = false |
| 232 is_posix = true | 245 is_posix = true |
| 233 is_win = false | 246 is_win = false |
| 234 } else if (current_os == "linux") { | 247 } else if (current_os == "linux") { |
| 235 is_android = false | 248 is_android = false |
| 236 is_chromeos = false | 249 is_chromeos_os = false |
| 237 is_ios = false | 250 is_ios = false |
| 238 is_linux = true | 251 is_linux = true |
| 239 is_mac = false | 252 is_mac = false |
| 240 is_nacl = false | 253 is_nacl = false |
| 241 is_posix = true | 254 is_posix = true |
| 242 is_win = false | 255 is_win = false |
| 243 } | 256 } |
| 244 | 257 |
| 245 # ============================================================================= | 258 # ============================================================================= |
| 246 # SOURCES FILTERS | 259 # SOURCES FILTERS |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 334 } |
| 322 if (!is_android) { | 335 if (!is_android) { |
| 323 sources_assignment_filter += [ | 336 sources_assignment_filter += [ |
| 324 "*_android.h", | 337 "*_android.h", |
| 325 "*_android.cc", | 338 "*_android.cc", |
| 326 "*_android_unittest.h", | 339 "*_android_unittest.h", |
| 327 "*_android_unittest.cc", | 340 "*_android_unittest.cc", |
| 328 "*\bandroid/*", | 341 "*\bandroid/*", |
| 329 ] | 342 ] |
| 330 } | 343 } |
| 344 |
| 345 #TODO(petermayo): Move this to features.gni with the removal of is_chromeos |
| 331 if (!is_chromeos) { | 346 if (!is_chromeos) { |
| 332 sources_assignment_filter += [ | 347 sources_assignment_filter += [ |
| 333 "*_chromeos.h", | 348 "*_chromeos.h", |
| 334 "*_chromeos.cc", | 349 "*_chromeos.cc", |
| 335 "*_chromeos_unittest.h", | 350 "*_chromeos_unittest.h", |
| 336 "*_chromeos_unittest.cc", | 351 "*_chromeos_unittest.cc", |
| 337 "*\bchromeos/*", | 352 "*\bchromeos/*", |
| 338 ] | 353 ] |
| 339 } | 354 } |
| 340 | 355 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 forward_variables_from(invoker, "*") | 633 forward_variables_from(invoker, "*") |
| 619 | 634 |
| 620 # All shared libraries must have the sanitizer deps to properly link in | 635 # All shared libraries must have the sanitizer deps to properly link in |
| 621 # asan mode (this target will be empty in other cases). | 636 # asan mode (this target will be empty in other cases). |
| 622 if (!defined(deps)) { | 637 if (!defined(deps)) { |
| 623 deps = [] | 638 deps = [] |
| 624 } | 639 } |
| 625 deps += [ "//build/config/sanitizers:deps" ] | 640 deps += [ "//build/config/sanitizers:deps" ] |
| 626 } | 641 } |
| 627 } | 642 } |
| OLD | NEW |