| 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 if (is_nacl) { | 51 source_set("base_paths") { |
| 52 # None of the files apply to nacl, and we can't make an empty static library. | 52 sources = [ |
| 53 group("base_paths") { | 53 "base_paths.cc", |
| 54 "base_paths.h", |
| 55 "base_paths_android.cc", |
| 56 "base_paths_android.h", |
| 57 "base_paths_mac.h", |
| 58 "base_paths_mac.mm", |
| 59 "base_paths_posix.cc", |
| 60 "base_paths_posix.h", |
| 61 "base_paths_win.cc", |
| 62 "base_paths_win.h", |
| 63 ] |
| 64 |
| 65 if (is_android || is_mac || is_ios) { |
| 66 sources -= [ "base_paths_posix.cc" ] |
| 54 } | 67 } |
| 55 } else { | 68 |
| 56 static_library("base_paths") { | 69 if (is_nacl) { |
| 57 sources = [ | 70 sources -= [ |
| 58 "base_paths.cc", | 71 "base_paths.cc", |
| 59 "base_paths.h", | |
| 60 "base_paths_android.cc", | |
| 61 "base_paths_android.h", | |
| 62 "base_paths_mac.h", | |
| 63 "base_paths_mac.mm", | |
| 64 "base_paths_posix.cc", | 72 "base_paths_posix.cc", |
| 65 "base_paths_posix.h", | |
| 66 "base_paths_win.cc", | |
| 67 "base_paths_win.h", | |
| 68 ] | 73 ] |
| 74 } |
| 69 | 75 |
| 70 if (is_android || is_mac || is_ios) { | 76 configs += [ ":base_implementation" ] |
| 71 sources -= [ "base_paths_posix.cc" ] | |
| 72 } | |
| 73 | 77 |
| 74 configs += [ ":base_implementation" ] | 78 deps = [ |
| 79 "//base/memory", |
| 80 "//base/process", |
| 81 ] |
| 75 | 82 |
| 76 deps = [ | 83 visibility = [ ":base" ] |
| 77 "//base/memory", | |
| 78 "//base/process", | |
| 79 ] | |
| 80 | |
| 81 visibility = [ ":base" ] | |
| 82 } | |
| 83 } | 84 } |
| 84 | 85 |
| 85 # Base and everything it depends on should be a static library rather than | 86 component("base") { |
| 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") { | |
| 103 sources = [ | 87 sources = [ |
| 104 "allocator/allocator_extension.cc", | 88 "allocator/allocator_extension.cc", |
| 105 "allocator/allocator_extension.h", | 89 "allocator/allocator_extension.h", |
| 106 "android/animation_frame_time_histogram.cc", | 90 "android/animation_frame_time_histogram.cc", |
| 107 "android/animation_frame_time_histogram.h", | 91 "android/animation_frame_time_histogram.h", |
| 108 "android/apk_assets.cc", | 92 "android/apk_assets.cc", |
| 109 "android/apk_assets.h", | 93 "android/apk_assets.h", |
| 110 "android/application_status_listener.cc", | 94 "android/application_status_listener.cc", |
| 111 "android/application_status_listener.h", | 95 "android/application_status_listener.h", |
| 112 "android/base_jni_onload.cc", | 96 "android/base_jni_onload.cc", |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 configs -= [ "//build/config/compiler:default_optimization" ] | 978 configs -= [ "//build/config/compiler:default_optimization" ] |
| 995 configs += [ "//build/config/compiler:optimize_max" ] | 979 configs += [ "//build/config/compiler:optimize_max" ] |
| 996 } | 980 } |
| 997 | 981 |
| 998 allow_circular_includes_from = public_deps | 982 allow_circular_includes_from = public_deps |
| 999 } | 983 } |
| 1000 | 984 |
| 1001 # This is the subset of files from base that should not be used with a dynamic | 985 # This is the subset of files from base that should not be used with a dynamic |
| 1002 # library. Note that this library cannot depend on base because base depends on | 986 # library. Note that this library cannot depend on base because base depends on |
| 1003 # base_static. | 987 # base_static. |
| 1004 static_library("base_static") { | 988 source_set("base_static") { |
| 1005 sources = [ | 989 sources = [ |
| 1006 "base_switches.cc", | 990 "base_switches.cc", |
| 1007 "base_switches.h", | 991 "base_switches.h", |
| 1008 "win/pe_image.cc", | 992 "win/pe_image.cc", |
| 1009 "win/pe_image.h", | 993 "win/pe_image.h", |
| 1010 ] | 994 ] |
| 1011 | 995 |
| 1012 if (!is_debug) { | 996 if (!is_debug) { |
| 1013 configs -= [ "//build/config/compiler:default_optimization" ] | 997 configs -= [ "//build/config/compiler:default_optimization" ] |
| 1014 configs += [ "//build/config/compiler:optimize_max" ] | 998 configs += [ "//build/config/compiler:optimize_max" ] |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 | 1771 |
| 1788 # GYP: //base.gyp:base_java_unittest_support | 1772 # GYP: //base.gyp:base_java_unittest_support |
| 1789 android_library("base_java_unittest_support") { | 1773 android_library("base_java_unittest_support") { |
| 1790 deps = [ | 1774 deps = [ |
| 1791 ":base_java", | 1775 ":base_java", |
| 1792 ] | 1776 ] |
| 1793 java_files = | 1777 java_files = |
| 1794 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ] | 1778 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ] |
| 1795 } | 1779 } |
| 1796 } | 1780 } |
| OLD | NEW |