| 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 # ============================================================================= |
| 6 # PLATFORM SELECTION |
| 7 # ============================================================================= |
| 8 # |
| 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. |
| 11 # |
| 12 # Users typically only set the variables "target_os" and "target_cpu" in "gn |
| 13 # args", the rest are set up by our build and internal to GN. |
| 14 # |
| 15 # There are three different types of each of these things: The "host" |
| 16 # represents the computer doing the compile and never changes. The "target" |
| 17 # represents the main thing we're trying to build. The "current" represents |
| 18 # which configuration is currently being defined, which can be either the |
| 19 # host, the target, or something completely different (like nacl). GN will |
| 20 # run the same build file multiple times for the different required |
| 21 # configuration in the same build. |
| 22 # |
| 23 # This gives the following variables: |
| 24 # - host_os, host_cpu, host_toolchain |
| 25 # - target_os, target_cpu, default_toolchain |
| 26 # - current_os, current_cpu, current_toolchain. |
| 27 # |
| 28 # Note the default_toolchain isn't symmetrical (you would expect |
| 29 # target_toolchain). This is because the "default" toolchain is a GN built-in |
| 30 # concept, and "target" is something our build sets up that's symmetrical with |
| 31 # its GYP counterpart. Potentially the built-in default_toolchain variable |
| 32 # could be renamed in the future. |
| 33 # |
| 34 # When writing build files, to do something only for the host: |
| 35 # if (current_toolchain == host_toolchain) { ... |
| 36 |
| 5 if (target_os == "") { | 37 if (target_os == "") { |
| 6 target_os = host_os | 38 target_os = host_os |
| 7 } | 39 } |
| 8 | 40 |
| 9 if (target_cpu == "") { | 41 if (target_cpu == "") { |
| 10 if (target_os == "android") { | 42 if (target_os == "android") { |
| 11 # If we're building for Android, we should assume that we want to | 43 # If we're building for Android, we should assume that we want to |
| 12 # build for ARM by default, not the host_cpu (which is likely x64). | 44 # build for ARM by default, not the host_cpu (which is likely x64). |
| 13 # This allows us to not have to specify both target_os and target_cpu | 45 # This allows us to not have to specify both target_os and target_cpu |
| 14 # on the command line. | 46 # on the command line. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 is_debug = true | 126 is_debug = true |
| 95 | 127 |
| 96 # Whether we're a traditional desktop unix. | 128 # Whether we're a traditional desktop unix. |
| 97 is_desktop_linux = current_os == "linux" && current_os != "chromeos" | 129 is_desktop_linux = current_os == "linux" && current_os != "chromeos" |
| 98 | 130 |
| 99 # Set to true when compiling with the Clang compiler. Typically this is used | 131 # Set to true when compiling with the Clang compiler. Typically this is used |
| 100 # to configure warnings. | 132 # to configure warnings. |
| 101 is_clang = current_os == "mac" || current_os == "ios" || | 133 is_clang = current_os == "mac" || current_os == "ios" || |
| 102 current_os == "linux" || current_os == "chromeos" | 134 current_os == "linux" || current_os == "chromeos" |
| 103 | 135 |
| 104 # Selects the desired build flavor. Official builds get additional | |
| 105 # processing to prepare for release. Normally you will want to develop and | |
| 106 # test with this flag off. | |
| 107 # TODO(brettw) move to chrome_build.gni when DEPS are updated. | |
| 108 is_official_build = false | |
| 109 | |
| 110 # Select the desired branding flavor. False means normal Chromium branding, | |
| 111 # true means official Google Chrome branding (requires extra Google-internal | |
| 112 # resources). | |
| 113 # TODO(brettw) move to chrome_build.gni when DEPS are updated. | |
| 114 is_chrome_branded = false | |
| 115 | |
| 116 # Compile for Address Sanitizer to find memory bugs. | 136 # Compile for Address Sanitizer to find memory bugs. |
| 117 is_asan = false | 137 is_asan = false |
| 118 | 138 |
| 119 # Compile for Leak Sanitizer to find leaks. | 139 # Compile for Leak Sanitizer to find leaks. |
| 120 is_lsan = false | 140 is_lsan = false |
| 121 | 141 |
| 122 # Compile for Memory Sanitizer to find uninitialized reads. | 142 # Compile for Memory Sanitizer to find uninitialized reads. |
| 123 is_msan = false | 143 is_msan = false |
| 124 | 144 |
| 125 # Compile for Thread Sanitizer to find threading bugs. | 145 # Compile for Thread Sanitizer to find threading bugs. |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 } | 788 } |
| 769 if (defined(invoker.testonly)) { | 789 if (defined(invoker.testonly)) { |
| 770 testonly = invoker.testonly | 790 testonly = invoker.testonly |
| 771 } | 791 } |
| 772 if (defined(invoker.visibility)) { | 792 if (defined(invoker.visibility)) { |
| 773 visibility = invoker.visibility | 793 visibility = invoker.visibility |
| 774 } | 794 } |
| 775 } | 795 } |
| 776 } | 796 } |
| 777 } | 797 } |
| OLD | NEW |