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 import("//build/config/compiler/compiler.gni") | 5 import("//build/config/compiler/compiler.gni") |
6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
7 import("//build/config/ui.gni") | 7 import("//build/config/ui.gni") |
8 import("//build/nocompile.gni") | 8 import("//build/nocompile.gni") |
9 import("//testing/test.gni") | 9 import("//testing/test.gni") |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (is_nacl_nonsfi) { | 41 if (is_nacl_nonsfi) { |
42 # Must be in a config because of how GN orders flags (otherwise -Wall will | 42 # Must be in a config because of how GN orders flags (otherwise -Wall will |
43 # appear after this, and turn it back on). | 43 # appear after this, and turn it back on). |
44 config("nacl_nonsfi_warnings") { | 44 config("nacl_nonsfi_warnings") { |
45 # file_util_posix.cc contains a function which is not | 45 # file_util_posix.cc contains a function which is not |
46 # being used by nacl_helper_nonsfi. | 46 # being used by nacl_helper_nonsfi. |
47 cflags = [ "-Wno-unused-function" ] | 47 cflags = [ "-Wno-unused-function" ] |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 source_set("base_paths") { | 51 if (is_nacl) { |
52 sources = [ | 52 # None of the files apply to nacl, and we can't make an empty static library. |
53 "base_paths.cc", | 53 group("base_paths") { |
54 "base_paths.h", | 54 } |
55 "base_paths_android.cc", | 55 } else { |
56 "base_paths_android.h", | 56 static_library("base_paths") { |
57 "base_paths_mac.h", | 57 sources = [ |
58 "base_paths_mac.mm", | 58 "base_paths.cc", |
59 "base_paths_posix.cc", | 59 "base_paths.h", |
60 "base_paths_posix.h", | 60 "base_paths_android.cc", |
61 "base_paths_win.cc", | 61 "base_paths_android.h", |
62 "base_paths_win.h", | 62 "base_paths_mac.h", |
63 ] | 63 "base_paths_mac.mm", |
| 64 "base_paths_posix.cc", |
| 65 "base_paths_posix.h", |
| 66 "base_paths_win.cc", |
| 67 "base_paths_win.h", |
| 68 ] |
64 | 69 |
65 if (is_android || is_mac || is_ios) { | 70 if (is_android || is_mac || is_ios) { |
66 sources -= [ "base_paths_posix.cc" ] | 71 sources -= [ "base_paths_posix.cc" ] |
| 72 } |
| 73 |
| 74 configs += [ ":base_implementation" ] |
| 75 |
| 76 deps = [ |
| 77 "//base/memory", |
| 78 "//base/process", |
| 79 ] |
| 80 |
| 81 visibility = [ ":base" ] |
67 } | 82 } |
68 | |
69 if (is_nacl) { | |
70 sources -= [ | |
71 "base_paths.cc", | |
72 "base_paths_posix.cc", | |
73 ] | |
74 } | |
75 | |
76 configs += [ ":base_implementation" ] | |
77 | |
78 deps = [ | |
79 "//base/memory", | |
80 "//base/process", | |
81 ] | |
82 | |
83 visibility = [ ":base" ] | |
84 } | 83 } |
85 | 84 |
86 component("base") { | 85 # Base and everything it depends on should be a static library rather than |
| 86 # a source set. Base is more of a "library" in the classic sense in that many |
| 87 # small parts of it are used in many different contexts. This combined with a |
| 88 # few static initializers floating around means that dead code stripping |
| 89 # still leaves a lot of code behind that isn't always used. For example, this |
| 90 # saves more than 40K for a smaller target like chrome_elf. |
| 91 # |
| 92 # Use static libraries for the helper stuff as well like //base/debug since |
| 93 # those things refer back to base code, which will force base compilation units |
| 94 # to be linked in where they wouldn't have otherwise. This does not include |
| 95 # test code (test support and anything in the test directory) which should use |
| 96 # source_set as is recommended for GN targets). |
| 97 if (is_component_build) { |
| 98 base_target_type = "shared_library" |
| 99 } else { |
| 100 base_target_type = "static_library" |
| 101 } |
| 102 target(base_target_type, "base") { |
87 sources = [ | 103 sources = [ |
88 "allocator/allocator_extension.cc", | 104 "allocator/allocator_extension.cc", |
89 "allocator/allocator_extension.h", | 105 "allocator/allocator_extension.h", |
90 "android/animation_frame_time_histogram.cc", | 106 "android/animation_frame_time_histogram.cc", |
91 "android/animation_frame_time_histogram.h", | 107 "android/animation_frame_time_histogram.h", |
92 "android/apk_assets.cc", | 108 "android/apk_assets.cc", |
93 "android/apk_assets.h", | 109 "android/apk_assets.h", |
94 "android/application_status_listener.cc", | 110 "android/application_status_listener.cc", |
95 "android/application_status_listener.h", | 111 "android/application_status_listener.h", |
96 "android/base_jni_onload.cc", | 112 "android/base_jni_onload.cc", |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 configs -= [ "//build/config/compiler:default_optimization" ] | 994 configs -= [ "//build/config/compiler:default_optimization" ] |
979 configs += [ "//build/config/compiler:optimize_max" ] | 995 configs += [ "//build/config/compiler:optimize_max" ] |
980 } | 996 } |
981 | 997 |
982 allow_circular_includes_from = public_deps | 998 allow_circular_includes_from = public_deps |
983 } | 999 } |
984 | 1000 |
985 # This is the subset of files from base that should not be used with a dynamic | 1001 # This is the subset of files from base that should not be used with a dynamic |
986 # library. Note that this library cannot depend on base because base depends on | 1002 # library. Note that this library cannot depend on base because base depends on |
987 # base_static. | 1003 # base_static. |
988 source_set("base_static") { | 1004 static_library("base_static") { |
989 sources = [ | 1005 sources = [ |
990 "base_switches.cc", | 1006 "base_switches.cc", |
991 "base_switches.h", | 1007 "base_switches.h", |
992 "win/pe_image.cc", | 1008 "win/pe_image.cc", |
993 "win/pe_image.h", | 1009 "win/pe_image.h", |
994 ] | 1010 ] |
995 | 1011 |
996 if (!is_debug) { | 1012 if (!is_debug) { |
997 configs -= [ "//build/config/compiler:default_optimization" ] | 1013 configs -= [ "//build/config/compiler:default_optimization" ] |
998 configs += [ "//build/config/compiler:optimize_max" ] | 1014 configs += [ "//build/config/compiler:optimize_max" ] |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 | 1787 |
1772 # GYP: //base.gyp:base_java_unittest_support | 1788 # GYP: //base.gyp:base_java_unittest_support |
1773 android_library("base_java_unittest_support") { | 1789 android_library("base_java_unittest_support") { |
1774 deps = [ | 1790 deps = [ |
1775 ":base_java", | 1791 ":base_java", |
1776 ] | 1792 ] |
1777 java_files = | 1793 java_files = |
1778 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ] | 1794 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ] |
1779 } | 1795 } |
1780 } | 1796 } |
OLD | NEW |