Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: build/config/BUILDCONFIG.gn

Issue 2509333003: Change GN to disallow reading args defined in the same declare_args() call. (Closed)
Patch Set: update w/ review feedback Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/config/ui.gni » ('j') | tools/gn/functions.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # WHAT IS THIS FILE? 6 # WHAT IS THIS FILE?
7 # ============================================================================= 7 # =============================================================================
8 # 8 #
9 # This is the master GN build configuration. This file is loaded after the 9 # This is the master GN build configuration. This file is loaded after the
10 # build args (args.gn) for the build directory and after the toplevel ".gn" 10 # build args (args.gn) for the build directory and after the toplevel ".gn"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 # even if the value is overridden, which is wasteful. See first bullet. 123 # even if the value is overridden, which is wasteful. See first bullet.
124 124
125 declare_args() { 125 declare_args() {
126 # Set to enable the official build level of optimization. This has nothing 126 # Set to enable the official build level of optimization. This has nothing
127 # to do with branding, but enables an additional level of optimization above 127 # to do with branding, but enables an additional level of optimization above
128 # release (!is_debug). This might be better expressed as a tri-state 128 # release (!is_debug). This might be better expressed as a tri-state
129 # (debug, release, official) but for historical reasons there are two 129 # (debug, release, official) but for historical reasons there are two
130 # separate flags. 130 # separate flags.
131 is_official_build = false 131 is_official_build = false
132 132
133 # Debug build. Enabling official builds automatically sets is_debug to false.
134 is_debug = !is_official_build
135
136 # Whether we're a traditional desktop unix. 133 # Whether we're a traditional desktop unix.
137 is_desktop_linux = current_os == "linux" 134 is_desktop_linux = current_os == "linux"
138 135
139 # Set to true when compiling with the Clang compiler. Typically this is used 136 # Set to true when compiling with the Clang compiler. Typically this is used
140 # to configure warnings. 137 # to configure warnings.
141 is_clang = current_os == "mac" || current_os == "ios" || 138 is_clang = current_os == "mac" || current_os == "ios" ||
142 current_os == "linux" || current_os == "chromeos" 139 current_os == "linux" || current_os == "chromeos"
143 140
144 # Allows the path to a custom target toolchain to be injected as a single 141 # Allows the path to a custom target toolchain to be injected as a single
145 # argument, and set as the default toolchain. 142 # argument, and set as the default toolchain.
146 custom_toolchain = "" 143 custom_toolchain = ""
147 144
148 # This should not normally be set as a build argument. It's here so that 145 # This should not normally be set as a build argument. It's here so that
149 # every toolchain can pass through the "global" value via toolchain_args(). 146 # every toolchain can pass through the "global" value via toolchain_args().
150 host_toolchain = "" 147 host_toolchain = ""
151 148
152 # DON'T ADD MORE FLAGS HERE. Read the comment above. 149 # DON'T ADD MORE FLAGS HERE. Read the comment above.
153 } 150 }
154 151
155 declare_args() { 152 declare_args() {
153 # Debug build. Enabling official builds automatically sets is_debug to false.
154 is_debug = !is_official_build
155 }
156
157 declare_args() {
156 # Component build. Setting to true compiles targets declared as "components" 158 # Component build. Setting to true compiles targets declared as "components"
157 # as shared libraries loaded dynamically. This speeds up development time. 159 # as shared libraries loaded dynamically. This speeds up development time.
158 # When false, components will be linked statically. 160 # When false, components will be linked statically.
159 # 161 #
160 # For more information see 162 # For more information see
161 # https://chromium.googlesource.com/chromium/src/+/master/docs/component_build .md 163 # https://chromium.googlesource.com/chromium/src/+/master/docs/component_build .md
162 is_component_build = is_debug && current_os != "ios" 164 is_component_build = is_debug && current_os != "ios"
163 } 165 }
164 166
165 assert(!(is_debug && is_official_build), "Can't do official debug builds") 167 assert(!(is_debug && is_official_build), "Can't do official debug builds")
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 set_defaults("component") { 645 set_defaults("component") {
644 if (is_component_build) { 646 if (is_component_build) {
645 configs = default_shared_library_configs 647 configs = default_shared_library_configs
646 if (is_android) { 648 if (is_android) {
647 configs -= [ "//build/config/android:hide_native_jni_exports" ] 649 configs -= [ "//build/config/android:hide_native_jni_exports" ]
648 } 650 }
649 } else { 651 } else {
650 configs = default_compiler_configs 652 configs = default_compiler_configs
651 } 653 }
652 } 654 }
OLDNEW
« no previous file with comments | « no previous file | build/config/ui.gni » ('j') | tools/gn/functions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698