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

Side by Side Diff: base/BUILD.gn

Issue 2867693004: Snapshot of all changes to get jumbo in blink and content.
Patch Set: Rebased again Created 3 years, 5 months 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 | base/memory/discardable_memory_allocator.cc » ('j') | no next file with comments »
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 # HOW TO WRITE CONDITIONALS IN THIS FILE 5 # HOW TO WRITE CONDITIONALS IN THIS FILE
6 # ====================================== 6 # ======================================
7 # 7 #
8 # In many other places, one would write a conditional that expresses all the 8 # In many other places, one would write a conditional that expresses all the
9 # cases when a source file is used or unused, and then either add or subtract 9 # cases when a source file is used or unused, and then either add or subtract
10 # it from the sources list in that case 10 # it from the sources list in that case
11 # 11 #
12 # Since base includes so many low-level things that vary widely and 12 # Since base includes so many low-level things that vary widely and
13 # unpredictably for the various build types, we prefer a slightly different 13 # unpredictably for the various build types, we prefer a slightly different
14 # style. Instead, there are big per-platform blocks of inclusions and 14 # style. Instead, there are big per-platform blocks of inclusions and
15 # exclusions. If a given file has an inclusion or exclusion rule that applies 15 # exclusions. If a given file has an inclusion or exclusion rule that applies
16 # for multiple conditions, prefer to duplicate it in both lists. This makes it 16 # for multiple conditions, prefer to duplicate it in both lists. This makes it
17 # a bit easier to see which files apply in which cases rather than having a 17 # a bit easier to see which files apply in which cases rather than having a
18 # huge sequence of random-looking conditionals. 18 # huge sequence of random-looking conditionals.
19 19
20 import("//build/buildflag_header.gni") 20 import("//build/buildflag_header.gni")
21 import("//build/config/allocator.gni") 21 import("//build/config/allocator.gni")
22 import("//build/config/arm.gni") 22 import("//build/config/arm.gni")
23 import("//build/config/chromecast_build.gni") 23 import("//build/config/chromecast_build.gni")
24 import("//build/config/clang/clang.gni") 24 import("//build/config/clang/clang.gni")
25 import("//build/config/compiler/compiler.gni") 25 import("//build/config/compiler/compiler.gni")
26 import("//build/config/dcheck_always_on.gni") 26 import("//build/config/dcheck_always_on.gni")
27 import("//build/config/jumbo.gni")
27 import("//build/config/nacl/config.gni") 28 import("//build/config/nacl/config.gni")
28 import("//build/config/sysroot.gni") 29 import("//build/config/sysroot.gni")
29 import("//build/config/ui.gni") 30 import("//build/config/ui.gni")
30 import("//build/nocompile.gni") 31 import("//build/nocompile.gni")
31 import("//testing/libfuzzer/fuzzer_test.gni") 32 import("//testing/libfuzzer/fuzzer_test.gni")
32 import("//testing/test.gni") 33 import("//testing/test.gni")
33 34
34 declare_args() { 35 declare_args() {
35 # Override this value to give a specific build date. 36 # Override this value to give a specific build date.
36 # See //base/build_time.cc and //build/write_build_date_header.py for more 37 # See //base/build_time.cc and //build/write_build_date_header.py for more
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 # small parts of it are used in many different contexts. This combined with a 94 # small parts of it are used in many different contexts. This combined with a
94 # few static initializers floating around means that dead code stripping 95 # few static initializers floating around means that dead code stripping
95 # still leaves a lot of code behind that isn't always used. For example, this 96 # still leaves a lot of code behind that isn't always used. For example, this
96 # saves more than 40K for a smaller target like chrome_elf. 97 # saves more than 40K for a smaller target like chrome_elf.
97 # 98 #
98 # Use static libraries for the helper stuff as well like //base/debug since 99 # Use static libraries for the helper stuff as well like //base/debug since
99 # those things refer back to base code, which will force base compilation units 100 # those things refer back to base code, which will force base compilation units
100 # to be linked in where they wouldn't have otherwise. This does not include 101 # to be linked in where they wouldn't have otherwise. This does not include
101 # test code (test support and anything in the test directory) which should use 102 # test code (test support and anything in the test directory) which should use
102 # source_set as is recommended for GN targets). 103 # source_set as is recommended for GN targets).
103 component("base") { 104 jumbo_component("base") {
105 target_type = "component"
106 if (is_nacl) {
107 # Link errors related to malloc functions if libbase for nacl is
108 # compiled with jumbo.
109 never_build_jumbo = true
110 }
104 if (is_nacl_nonsfi) { 111 if (is_nacl_nonsfi) {
105 # TODO(phosek) bug 570839: If field_trial.cc is in a static library, 112 # TODO(phosek) bug 570839: If field_trial.cc is in a static library,
106 # nacl_helper_nonsfi doesn't link properly on Linux in debug builds. The 113 # nacl_helper_nonsfi doesn't link properly on Linux in debug builds. The
107 # reasons for this seem to involve obscure toolchain bugs. This should be 114 # reasons for this seem to involve obscure toolchain bugs. This should be
108 # fixed and this target should always be a static_library in the 115 # fixed and this target should always be a static_library in the
109 # non-component case. 116 # non-component case.
110 static_component_type = "source_set" 117 static_component_type = "source_set"
111 } 118 }
112 119
113 sources = [ 120 sources = [
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 ] 1146 ]
1140 1147
1141 # Needed for <atomic> if using newer C++ library than sysroot, except if 1148 # Needed for <atomic> if using newer C++ library than sysroot, except if
1142 # building inside the cros_sdk environment - use host_toolchain as a 1149 # building inside the cros_sdk environment - use host_toolchain as a
1143 # more robust check for this. 1150 # more robust check for this.
1144 if (!use_sysroot && (is_android || (is_linux && !is_chromecast)) && 1151 if (!use_sysroot && (is_android || (is_linux && !is_chromecast)) &&
1145 host_toolchain != "//build/toolchain/cros:host") { 1152 host_toolchain != "//build/toolchain/cros:host") {
1146 libs = [ "atomic" ] 1153 libs = [ "atomic" ]
1147 } 1154 }
1148 1155
1156 jumbo_excluded_sources = [
1157 # Works on a header without include guards: base/trace_event_common.h.
1158 "trace_event/trace_event_argument.cc",
1159 ]
1160
1161
1149 if (use_allocator_shim) { 1162 if (use_allocator_shim) {
1150 sources += [ 1163 sources += [
1151 "allocator/allocator_shim.cc", 1164 "allocator/allocator_shim.cc",
1152 "allocator/allocator_shim.h", 1165 "allocator/allocator_shim.h",
1153 "allocator/allocator_shim_internals.h", 1166 "allocator/allocator_shim_internals.h",
1154 "allocator/allocator_shim_override_cpp_symbols.h", 1167 "allocator/allocator_shim_override_cpp_symbols.h",
1155 "allocator/allocator_shim_override_libc_symbols.h", 1168 "allocator/allocator_shim_override_libc_symbols.h",
1156 ] 1169 ]
1170 jumbo_excluded_sources += [
1171 "allocator/allocator_shim.cc",
1172 ]
1157 if (is_win) { 1173 if (is_win) {
1158 sources += [ 1174 sources += [
1159 "allocator/allocator_shim_default_dispatch_to_winheap.cc", 1175 "allocator/allocator_shim_default_dispatch_to_winheap.cc",
1160 "allocator/allocator_shim_override_ucrt_symbols_win.h", 1176 "allocator/allocator_shim_override_ucrt_symbols_win.h",
1161 "allocator/winheap_stubs_win.cc", 1177 "allocator/winheap_stubs_win.cc",
1162 "allocator/winheap_stubs_win.h", 1178 "allocator/winheap_stubs_win.h",
1163 ] 1179 ]
1164 } else if (is_linux && use_allocator == "tcmalloc") { 1180 } else if (is_linux && use_allocator == "tcmalloc") {
1165 sources += [ 1181 sources += [
1166 "allocator/allocator_shim_default_dispatch_to_tcmalloc.cc", 1182 "allocator/allocator_shim_default_dispatch_to_tcmalloc.cc",
1167 "allocator/allocator_shim_override_glibc_weak_symbols.h", 1183 "allocator/allocator_shim_override_glibc_weak_symbols.h",
1168 ] 1184 ]
1169 deps += [ "//base/allocator:tcmalloc" ] 1185 deps += [ "//base/allocator:tcmalloc" ]
1170 } else if (is_linux && use_allocator == "none") { 1186 } else if (is_linux && use_allocator == "none") {
1171 sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ] 1187 sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ]
1172 } else if (is_android && use_allocator == "none") { 1188 } else if (is_android && use_allocator == "none") {
1173 sources += [ 1189 sources += [
1174 "allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc" , 1190 "allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc" ,
1175 "allocator/allocator_shim_override_linker_wrapped_symbols.h", 1191 "allocator/allocator_shim_override_linker_wrapped_symbols.h",
1176 ] 1192 ]
1177 all_dependent_configs += [ "//base/allocator:wrap_malloc_symbols" ] 1193 all_dependent_configs += [ "//base/allocator:wrap_malloc_symbols" ]
1194 jumbo_excluded_sources += [
1195 "allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc" ,
1196 ]
1178 } else if (is_mac) { 1197 } else if (is_mac) {
1179 sources += [ 1198 sources += [
1180 "allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc", 1199 "allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc",
1181 "allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h", 1200 "allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h",
1182 "allocator/allocator_shim_override_mac_symbols.h", 1201 "allocator/allocator_shim_override_mac_symbols.h",
1183 ] 1202 ]
1184 } 1203 }
1185 } 1204 }
1186 1205
1187 # Allow more direct string conversions on platforms with native utf8 1206 # Allow more direct string conversions on platforms with native utf8
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2804 } 2823 }
2805 2824
2806 fuzzer_test("base_json_correctness_fuzzer") { 2825 fuzzer_test("base_json_correctness_fuzzer") {
2807 sources = [ 2826 sources = [
2808 "json/correctness_fuzzer.cc", 2827 "json/correctness_fuzzer.cc",
2809 ] 2828 ]
2810 deps = [ 2829 deps = [
2811 ":base", 2830 ":base",
2812 ] 2831 ]
2813 } 2832 }
OLDNEW
« no previous file with comments | « no previous file | base/memory/discardable_memory_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698