OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
6 import("//build/split_static_library.gni") | |
7 import("//third_party/WebKit/Source/config.gni") | 6 import("//third_party/WebKit/Source/config.gni") |
8 | 7 |
9 blink_core_output_dir = "$root_gen_dir/blink/core" | 8 blink_core_output_dir = "$root_gen_dir/blink/core" |
10 | 9 |
11 # This file sets core_config_add and core_config_remove lists of configs to | 10 # This file sets core_config_add and core_config_remove lists of configs to |
12 # modify the default lists of configs set in the build as appropriate for core | 11 # modify the default lists of configs set in the build as appropriate for core |
13 # targets. This avoids duplicating logic across many targets. | 12 # targets. This avoids duplicating logic across many targets. |
14 core_config_add = [ | 13 core_config_add = [ |
15 "//build/config/compiler:wexit_time_destructors", | 14 "//build/config/compiler:wexit_time_destructors", |
16 "//third_party/WebKit/Source:config", | 15 "//third_party/WebKit/Source:config", |
(...skipping 23 matching lines...) Expand all Loading... |
40 # source sets. | 39 # source sets. |
41 core_link_large_target_type = "source_set" | 40 core_link_large_target_type = "source_set" |
42 core_link_small_target_type = "source_set" | 41 core_link_small_target_type = "source_set" |
43 } else { | 42 } else { |
44 # In static builds some of the libraries can get >2GB on Windows so we need | 43 # In static builds some of the libraries can get >2GB on Windows so we need |
45 # to split the targets for the larger ones. | 44 # to split the targets for the larger ones. |
46 core_link_large_target_type = "split_static_library" | 45 core_link_large_target_type = "split_static_library" |
47 core_link_small_target_type = "static_library" | 46 core_link_small_target_type = "static_library" |
48 } | 47 } |
49 | 48 |
50 # Use this to generate a static library or source set that gets linked into | |
51 # "core". This will either be a source_set (component build), a static library | |
52 # (split_count undefined) or a split static library (split_count defined). | |
53 # | |
54 # Special values. All unlisted values are forwarded to the underlying library. | |
55 # | |
56 # configs | |
57 # Normal meaning. The set_defaults call below will make the default value | |
58 # of configs in the calling code take into account the core_config_add and | |
59 # core_config_remove lists above. So you don't need to manually take these | |
60 # into account: just modify the configs as normal for target-specific | |
61 # overrides (or don't touch it). | |
62 # | |
63 # split_count | |
64 # If defined, non-component builds will generate this number of static | |
65 # libraries by splitting the sources. This is for use on Windows where the | |
66 # maximum static library size is 2GB, and 64-bit builds with full symbols | |
67 # can exceed this if there are many sources. | |
68 # | |
69 # deps | |
70 # Normal meaning but "core:prerequisites" target is always added. Callers | |
71 # shouldn'y list prerequisites as a dependency. | |
72 # | |
73 # visibility | |
74 # Normal meaning if defined. If undefined, defaults to everything in core. | |
75 template("blink_core_sources") { | |
76 if (is_component_build) { | |
77 target_type = "source_set" | |
78 | |
79 # This assert avoids an unused variable warning. | |
80 assert(!defined(invoker.split_count) || invoker.split_count != 0) | |
81 } else if (!defined(invoker.split_count)) { | |
82 target_type = "static_library" | |
83 } else { | |
84 target_type = "split_static_library" | |
85 } | |
86 | |
87 target(target_type, target_name) { | |
88 # The visibility will get overridden by forward_variables_from below if the | |
89 # invoker defined it. | |
90 visibility = [ "//third_party/WebKit/Source/core/*" ] | |
91 | |
92 if (target_type == "split_static_library") { | |
93 split_count = invoker.split_count | |
94 } | |
95 | |
96 deps = [ | |
97 "//third_party/WebKit/Source/core:prerequisites", | |
98 ] | |
99 if (defined(invoker.deps)) { | |
100 deps += invoker.deps | |
101 } | |
102 | |
103 # Take everything else not handled above from the invoker. | |
104 forward_variables_from(invoker, | |
105 "*", | |
106 [ | |
107 "deps", | |
108 "split_count", | |
109 ]) | |
110 } | |
111 } | |
112 set_defaults("blink_core_sources") { | |
113 # This sets the default list of configs when the blink_core_sources target | |
114 # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and | |
115 # is the list normally applied to static libraries and source sets. | |
116 configs = default_compiler_configs - core_config_remove + core_config_add | |
117 } | |
118 | |
119 # This file is the GN version of core.gypi. We rebase most paths to be absolute | 49 # This file is the GN version of core.gypi. We rebase most paths to be absolute |
120 # so these lists can be used by BUILD files in different directories without | 50 # so these lists can be used by BUILD files in different directories without |
121 # worrying about the base directory. | 51 # worrying about the base directory. |
122 _gypi = | 52 _gypi = |
123 exec_script("//build/gypi_to_gn.py", | 53 exec_script("//build/gypi_to_gn.py", |
124 [ | 54 [ |
125 rebase_path("core.gypi"), | 55 rebase_path("core.gypi"), |
126 "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir", | 56 "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir", |
127 "--replace=<(blink_core_output_dir)=$blink_core_output_dir", | 57 "--replace=<(blink_core_output_dir)=$blink_core_output_dir", |
128 ], | 58 ], |
(...skipping 17 matching lines...) Expand all Loading... |
146 | 76 |
147 # Interfaces that inherit from Event, including Event itself. | 77 # Interfaces that inherit from Event, including Event itself. |
148 core_event_idl_files = get_path_info(_gypi.core_event_idl_files, "abspath") | 78 core_event_idl_files = get_path_info(_gypi.core_event_idl_files, "abspath") |
149 | 79 |
150 # IDL files that only have typedefs/enums. | 80 # IDL files that only have typedefs/enums. |
151 core_typedefs_enums_only_idl_files = | 81 core_typedefs_enums_only_idl_files = |
152 get_path_info(_gypi.core_typedefs_enums_only_idl_files, "abspath") | 82 get_path_info(_gypi.core_typedefs_enums_only_idl_files, "abspath") |
153 | 83 |
154 webcore_non_rendering_files = | 84 webcore_non_rendering_files = |
155 get_path_info(_gypi.webcore_non_rendering_files, "abspath") | 85 get_path_info(_gypi.webcore_non_rendering_files, "abspath") |
| 86 webcore_rendering_files = |
| 87 get_path_info(_gypi.webcore_rendering_files, "abspath") |
156 webcore_testing_idl_files = | 88 webcore_testing_idl_files = |
157 get_path_info(_gypi.webcore_testing_idl_files, "abspath") | 89 get_path_info(_gypi.webcore_testing_idl_files, "abspath") |
158 webcore_testing_idl_with_modules_dependency_files = | 90 webcore_testing_idl_with_modules_dependency_files = |
159 get_path_info(_gypi.webcore_testing_idl_with_modules_dependency_files, | 91 get_path_info(_gypi.webcore_testing_idl_with_modules_dependency_files, |
160 "abspath") | 92 "abspath") |
161 webcore_testing_dependency_idl_files = | 93 webcore_testing_dependency_idl_files = |
162 get_path_info(_gypi.webcore_testing_dependency_idl_files, "abspath") | 94 get_path_info(_gypi.webcore_testing_dependency_idl_files, "abspath") |
163 generated_core_dictionary_files = | 95 generated_core_dictionary_files = |
164 get_path_info(_gypi.generated_core_dictionary_files, "abspath") | 96 get_path_info(_gypi.generated_core_dictionary_files, "abspath") |
165 generated_core_testing_dictionary_files = | 97 generated_core_testing_dictionary_files = |
166 get_path_info(_gypi.generated_core_testing_dictionary_files, "abspath") | 98 get_path_info(_gypi.generated_core_testing_dictionary_files, "abspath") |
167 generated_webcore_testing_idl_files = | 99 generated_webcore_testing_idl_files = |
168 get_path_info(_gypi.generated_webcore_testing_idl_files, "abspath") | 100 get_path_info(_gypi.generated_webcore_testing_idl_files, "abspath") |
169 webcore_testing_files = get_path_info(_gypi.webcore_testing_files, "abspath") | 101 webcore_testing_files = get_path_info(_gypi.webcore_testing_files, "abspath") |
OLD | NEW |