| 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 # BUILD FLAGS | 6 # BUILD FLAGS |
| 7 # ============================================================================= | 7 # ============================================================================= |
| 8 # | 8 # |
| 9 # This block lists input arguments to the build, along with their default | 9 # This block lists input arguments to the build, along with their default |
| 10 # values. GN requires listing them explicitly so it can validate input and have | 10 # values. GN requires listing them explicitly so it can validate input and have |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 # Component build. | 28 # Component build. |
| 29 is_component_build = false | 29 is_component_build = false |
| 30 # Debug build. | 30 # Debug build. |
| 31 is_debug = true | 31 is_debug = true |
| 32 | 32 |
| 33 # Set to true when compiling with the Clang compiler. Typically this is used | 33 # Set to true when compiling with the Clang compiler. Typically this is used |
| 34 # to configure warnings. | 34 # to configure warnings. |
| 35 is_clang = (os == "mac" || os == "ios" || os == "linux" || os == "chromeos") | 35 is_clang = (os == "mac" || os == "ios" || os == "linux" || os == "chromeos") |
| 36 | 36 |
| 37 # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally | |
| 38 # we build 32-bit on Windows regardless of the current host OS bit depth. | |
| 39 # Setting this flag will override this logic and generate 64-bit toolchains. | |
| 40 # | |
| 41 # Normally this would get set automatically when you specify a target using | |
| 42 # the 64-bit toolchain. You can also set this on the command line to convert | |
| 43 # the default toolchain to 64-bit. | |
| 44 force_win64 = false | |
| 45 | |
| 46 # Selects the desired build flavor. Official builds get additional | 37 # Selects the desired build flavor. Official builds get additional |
| 47 # processing to prepare for release. Normally you will want to develop and | 38 # processing to prepare for release. Normally you will want to develop and |
| 48 # test with this flag off. | 39 # test with this flag off. |
| 49 is_official_build = false | 40 is_official_build = false |
| 50 | 41 |
| 51 # Select the desired branding flavor. False means normal Chromium branding, | 42 # Select the desired branding flavor. False means normal Chromium branding, |
| 52 # true means official Google Chrome branding (requires extra Google-internal | 43 # true means official Google Chrome branding (requires extra Google-internal |
| 53 # resources). | 44 # resources). |
| 54 is_chrome_branded = false | 45 is_chrome_branded = false |
| 55 | 46 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 is_posix = true | 158 is_posix = true |
| 168 is_win = false | 159 is_win = false |
| 169 } | 160 } |
| 170 | 161 |
| 171 is_desktop_linux = is_linux && !is_chromeos | 162 is_desktop_linux = is_linux && !is_chromeos |
| 172 | 163 |
| 173 # ============================================================================= | 164 # ============================================================================= |
| 174 # CPU ARCHITECTURE | 165 # CPU ARCHITECTURE |
| 175 # ============================================================================= | 166 # ============================================================================= |
| 176 | 167 |
| 177 if (is_win) { | |
| 178 # Always use 32-bit on Windows, even when compiling on a 64-bit host OS, | |
| 179 # unless the override flag is specified. | |
| 180 if (force_win64) { | |
| 181 cpu_arch = "x64" | |
| 182 } else { | |
| 183 cpu_arch = "x86" | |
| 184 } | |
| 185 } | |
| 186 | |
| 187 if (is_android) { | 168 if (is_android) { |
| 188 # TODO(cjhopman): enable this assert once bots are updated to not set | 169 # TODO(cjhopman): enable this assert once bots are updated to not set |
| 189 # cpu_arch. | 170 # cpu_arch. |
| 190 #assert(cpu_arch == build_cpu_arch, "Android device target architecture should | 171 #assert(cpu_arch == build_cpu_arch, "Android device target architecture should |
| 191 # be set with 'target_arch', not 'cpu_arch'") | 172 # be set with 'target_arch', not 'cpu_arch'") |
| 192 cpu_arch = target_arch | 173 cpu_arch = target_arch |
| 193 } | 174 } |
| 194 | 175 |
| 195 # ============================================================================= | 176 # ============================================================================= |
| 196 # SOURCES FILTERS | 177 # SOURCES FILTERS |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 # ============================================================================== | 469 # ============================================================================== |
| 489 # TOOLCHAIN SETUP | 470 # TOOLCHAIN SETUP |
| 490 # ============================================================================== | 471 # ============================================================================== |
| 491 # | 472 # |
| 492 # Here we set the default toolchain, as well as the variable host_toolchain | 473 # Here we set the default toolchain, as well as the variable host_toolchain |
| 493 # which will identify the toolchain corresponding to the local system when | 474 # which will identify the toolchain corresponding to the local system when |
| 494 # doing cross-compiles. When not cross-compiling, this will be the same as the | 475 # doing cross-compiles. When not cross-compiling, this will be the same as the |
| 495 # default toolchain. | 476 # default toolchain. |
| 496 | 477 |
| 497 if (is_win) { | 478 if (is_win) { |
| 498 # TODO(brettw) name the toolchains the same as cpu_arch as with Linux below | 479 # On windows we use the same toolchain for host and target by default. |
| 499 # to eliminate these conditionals. | 480 # TODO(dpranke): rename the toolchains to x64 and x86 to match cpu_arch. |
| 500 if (build_cpu_arch == "x64") { | 481 if (cpu_arch == "x64") { |
| 501 host_toolchain = "//build/toolchain/win:64" | 482 host_toolchain = "//build/toolchain/win:64" |
| 502 } else if (build_cpu_arch == "x86") { | 483 } else if (cpu_arch == "x86") { |
| 503 host_toolchain = "//build/toolchain/win:32" | 484 host_toolchain = "//build/toolchain/win:32" |
| 504 } | 485 } |
| 505 | 486 set_default_toolchain("$host_toolchain") |
| 506 if (cpu_arch == "x64") { | |
| 507 set_default_toolchain("//build/toolchain/win:64") | |
| 508 } else if (cpu_arch == "x86") { | |
| 509 set_default_toolchain("//build/toolchain/win:32") | |
| 510 } | |
| 511 } else if (is_android) { | 487 } else if (is_android) { |
| 512 # Use clang for the x86/64 Linux host builds. | 488 # Use clang for the x86/64 Linux host builds. |
| 513 if (build_cpu_arch == "x86" || build_cpu_arch == "x64") { | 489 if (build_cpu_arch == "x86" || build_cpu_arch == "x64") { |
| 514 host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch" | 490 host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch" |
| 515 } else { | 491 } else { |
| 516 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" | 492 host_toolchain = "//build/toolchain/linux:$build_cpu_arch" |
| 517 } | 493 } |
| 518 set_default_toolchain("//build/toolchain/android:$cpu_arch") | 494 set_default_toolchain("//build/toolchain/android:$cpu_arch") |
| 519 } else if (is_linux) { | 495 } else if (is_linux) { |
| 520 if (is_clang) { | 496 if (is_clang) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 if (defined(invoker.output_extension)) { output_extension = invoker.output
_extension } | 692 if (defined(invoker.output_extension)) { output_extension = invoker.output
_extension } |
| 717 if (defined(invoker.output_name)) { output_name = invoker.output_name } | 693 if (defined(invoker.output_name)) { output_name = invoker.output_name } |
| 718 if (defined(invoker.public)) { public = invoker.public } | 694 if (defined(invoker.public)) { public = invoker.public } |
| 719 if (defined(invoker.public_configs)) { public_configs = invoker.public_con
figs } | 695 if (defined(invoker.public_configs)) { public_configs = invoker.public_con
figs } |
| 720 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } | 696 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } |
| 721 if (defined(invoker.sources)) { sources = invoker.sources } | 697 if (defined(invoker.sources)) { sources = invoker.sources } |
| 722 if (defined(invoker.visibility)) { visibility = invoker.visibility } | 698 if (defined(invoker.visibility)) { visibility = invoker.visibility } |
| 723 } | 699 } |
| 724 } | 700 } |
| 725 } | 701 } |
| OLD | NEW |