OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 # Chrome elf targets (excepting tests) should only link in kernel32. | 5 # Chrome elf targets (excepting tests) should only link in kernel32. |
6 # Please don't add dependencies on any other system libraries. | 6 # Please don't add dependencies on any other system libraries. |
7 | 7 |
8 import("//build/config/win/manifest.gni") | 8 import("//build/config/win/manifest.gni") |
9 import("//chrome/version.gni") | 9 import("//chrome/version.gni") |
10 import("//testing/test.gni") | 10 import("//testing/test.gni") |
(...skipping 29 matching lines...) Expand all Loading... |
40 "chrome_elf_main.cc", | 40 "chrome_elf_main.cc", |
41 "chrome_elf_main.h", | 41 "chrome_elf_main.h", |
42 ] | 42 ] |
43 deps = [ | 43 deps = [ |
44 ":blacklist", | 44 ":blacklist", |
45 ":chrome_elf_manifest", | 45 ":chrome_elf_manifest", |
46 ":chrome_elf_resources", | 46 ":chrome_elf_resources", |
47 ":chrome_elf_security", | 47 ":chrome_elf_security", |
48 ":constants", | 48 ":constants", |
49 ":hook_util", | 49 ":hook_util", |
| 50 ":nt_registry", |
50 "//base", | 51 "//base", |
51 "//build/config/sanitizers:deps", | 52 "//build/config/sanitizers:deps", |
52 "//chrome/install_static:install_static_util", | 53 "//chrome/install_static:install_static_util", |
53 "//chrome_elf/nt_registry:nt_registry", | |
54 "//components/crash/content/app", | 54 "//components/crash/content/app", |
55 "//components/crash/core/common", | 55 "//components/crash/core/common", |
56 "//content/public/common:result_codes", | 56 "//content/public/common:result_codes", |
57 "//third_party/crashpad/crashpad/client:client", | 57 "//third_party/crashpad/crashpad/client:client", |
58 ] | 58 ] |
59 configs += [ "//build/config/win:windowed" ] | 59 configs += [ "//build/config/win:windowed" ] |
60 configs -= [ "//build/config/win:console" ] | 60 configs -= [ "//build/config/win:console" ] |
61 ldflags = [ | 61 ldflags = [ |
62 "/NODEFAULTLIB:user32.lib", | 62 "/NODEFAULTLIB:user32.lib", |
63 "/DELAYLOAD:dbghelp.dll", | 63 "/DELAYLOAD:dbghelp.dll", |
(...skipping 16 matching lines...) Expand all Loading... |
80 ## source sets | 80 ## source sets |
81 ##------------------------------------------------------------------------------ | 81 ##------------------------------------------------------------------------------ |
82 | 82 |
83 source_set("chrome_elf_security") { | 83 source_set("chrome_elf_security") { |
84 sources = [ | 84 sources = [ |
85 "chrome_elf_security.cc", | 85 "chrome_elf_security.cc", |
86 "chrome_elf_security.h", | 86 "chrome_elf_security.h", |
87 ] | 87 ] |
88 deps = [ | 88 deps = [ |
89 ":constants", | 89 ":constants", |
90 "//chrome_elf/nt_registry:nt_registry", | 90 ":nt_registry", |
91 ] | 91 ] |
92 } | 92 } |
93 | 93 |
94 source_set("constants") { | 94 source_set("constants") { |
95 sources = [ | 95 sources = [ |
96 "chrome_elf_constants.cc", | 96 "chrome_elf_constants.cc", |
97 "chrome_elf_constants.h", | 97 "chrome_elf_constants.h", |
98 ] | 98 ] |
99 } | 99 } |
100 | 100 |
(...skipping 30 matching lines...) Expand all Loading... |
131 "blacklist/blacklist_interceptions.h", | 131 "blacklist/blacklist_interceptions.h", |
132 "blacklist/crashpad_helper.cc", | 132 "blacklist/crashpad_helper.cc", |
133 "blacklist/crashpad_helper.h", | 133 "blacklist/crashpad_helper.h", |
134 ] | 134 ] |
135 public_deps = [ | 135 public_deps = [ |
136 "//sandbox", | 136 "//sandbox", |
137 ] | 137 ] |
138 deps = [ | 138 deps = [ |
139 ":constants", | 139 ":constants", |
140 ":hook_util", | 140 ":hook_util", |
| 141 ":nt_registry", |
141 "//chrome/install_static:install_static_util", | 142 "//chrome/install_static:install_static_util", |
142 "//chrome_elf/nt_registry:nt_registry", | |
143 | 143 |
144 # Still uses base/win/pe_image.h | 144 # Still uses base/win/pe_image.h |
145 "//base", | 145 "//base", |
146 "//third_party/crashpad/crashpad/client:client", | 146 "//third_party/crashpad/crashpad/client:client", |
147 ] | 147 ] |
148 } | 148 } |
149 | 149 |
150 static_library("hook_util") { | 150 static_library("hook_util") { |
151 sources = [ | 151 sources = [ |
152 "hook_util/thunk_getter.cc", | 152 "hook_util/thunk_getter.cc", |
153 "hook_util/thunk_getter.h", | 153 "hook_util/thunk_getter.h", |
154 ] | 154 ] |
155 deps = [ | 155 deps = [ |
156 "//sandbox", | 156 "//sandbox", |
157 ] | 157 ] |
158 } | 158 } |
159 | 159 |
| 160 # This target contains utility functions which must only depend on |
| 161 # kernel32. Please don't add dependencies on other system libraries. |
| 162 static_library("nt_registry") { |
| 163 sources = [ |
| 164 "../sandbox/win/src/nt_internals.h", |
| 165 "nt_registry/nt_registry.cc", |
| 166 "nt_registry/nt_registry.h", |
| 167 ] |
| 168 |
| 169 libs = [ "kernel32.lib" ] |
| 170 } |
| 171 |
160 ##------------------------------------------------------------------------------ | 172 ##------------------------------------------------------------------------------ |
161 ## tests | 173 ## tests |
162 ##------------------------------------------------------------------------------ | 174 ##------------------------------------------------------------------------------ |
163 | 175 |
164 test("chrome_elf_unittests") { | 176 test("chrome_elf_unittests") { |
165 output_name = "chrome_elf_unittests" | 177 output_name = "chrome_elf_unittests" |
166 sources = [ | 178 sources = [ |
167 "blacklist/test/blacklist_test.cc", | 179 "blacklist/test/blacklist_test.cc", |
168 "chrome_elf_util_unittest.cc", | 180 "chrome_elf_util_unittest.cc", |
169 "elf_imports_unittest.cc", | 181 "elf_imports_unittest.cc", |
| 182 "nt_registry/nt_registry_unittest.cc", |
170 "run_all_unittests.cc", | 183 "run_all_unittests.cc", |
171 ] | 184 ] |
172 include_dirs = [ "$target_gen_dir" ] | 185 include_dirs = [ "$target_gen_dir" ] |
173 deps = [ | 186 deps = [ |
174 ":blacklist", | 187 ":blacklist", |
175 ":blacklist_test_main_dll", | 188 ":blacklist_test_main_dll", |
176 ":chrome_elf_security", | 189 ":chrome_elf_security", |
177 ":constants", | 190 ":constants", |
178 ":hook_util", | 191 ":hook_util", |
| 192 ":nt_registry", |
179 "//base", | 193 "//base", |
180 "//base/test:test_support", | 194 "//base/test:test_support", |
181 "//chrome", | 195 "//chrome", |
182 "//chrome/common:version_header", | 196 "//chrome/common:version_header", |
183 "//chrome/install_static:install_static_util", | 197 "//chrome/install_static:install_static_util", |
184 "//chrome_elf/nt_registry:nt_registry", | |
185 "//sandbox", | 198 "//sandbox", |
186 "//testing/gtest", | 199 "//testing/gtest", |
187 ] | 200 ] |
188 | 201 |
189 # It's not easily possible to have //chrome in data_deps without changing | 202 # It's not easily possible to have //chrome in data_deps without changing |
190 # the //chrome target to bundle up both initial/chrome.exe and chrome.exe. | 203 # the //chrome target to bundle up both initial/chrome.exe and chrome.exe. |
191 # As a workaround, explicitly include a data dep on just chrome.exe, and | 204 # As a workaround, explicitly include a data dep on just chrome.exe, and |
192 # add //chrome to deps above to make sure it's been built. | 205 # add //chrome to deps above to make sure it's been built. |
193 data = [ | 206 data = [ |
194 "$root_out_dir/chrome.exe", | 207 "$root_out_dir/chrome.exe", |
(...skipping 18 matching lines...) Expand all Loading... |
213 ] | 226 ] |
214 } | 227 } |
215 | 228 |
216 shared_library("blacklist_test_main_dll") { | 229 shared_library("blacklist_test_main_dll") { |
217 sources = [ | 230 sources = [ |
218 "blacklist/test/blacklist_test_main_dll.cc", | 231 "blacklist/test/blacklist_test_main_dll.cc", |
219 "blacklist/test/blacklist_test_main_dll.def", | 232 "blacklist/test/blacklist_test_main_dll.def", |
220 ] | 233 ] |
221 deps = [ | 234 deps = [ |
222 ":blacklist", | 235 ":blacklist", |
| 236 ":nt_registry", |
223 "//base", | 237 "//base", |
224 "//build/config/sanitizers:deps", | 238 "//build/config/sanitizers:deps", |
225 "//chrome/install_static:install_static_util", | 239 "//chrome/install_static:install_static_util", |
226 "//chrome_elf/nt_registry:nt_registry", | |
227 ] | 240 ] |
228 ldflags = [ | 241 ldflags = [ |
229 "/NODEFAULTLIB:user32.lib", | 242 "/NODEFAULTLIB:user32.lib", |
230 "/DELAYLOAD:dbghelp.dll", | 243 "/DELAYLOAD:dbghelp.dll", |
231 "/DELAYLOAD:ole32.dll", | 244 "/DELAYLOAD:ole32.dll", |
232 "/DELAYLOAD:psapi.dll", | 245 "/DELAYLOAD:psapi.dll", |
233 "/DELAYLOAD:rpcrt4.dll", | 246 "/DELAYLOAD:rpcrt4.dll", |
234 "/DELAYLOAD:shell32.dll", | 247 "/DELAYLOAD:shell32.dll", |
235 "/DELAYLOAD:user32.dll", | 248 "/DELAYLOAD:user32.dll", |
236 "/DELAYLOAD:winhttp.dll", | 249 "/DELAYLOAD:winhttp.dll", |
(...skipping 28 matching lines...) Expand all Loading... |
265 # which does), Ninja would get confused and always rebuild this target because | 278 # which does), Ninja would get confused and always rebuild this target because |
266 # it sees a declared output file but that file doesn't exist on disk. | 279 # it sees a declared output file but that file doesn't exist on disk. |
267 loadable_module("blacklist_test_dll_3") { | 280 loadable_module("blacklist_test_dll_3") { |
268 sources = [ | 281 sources = [ |
269 "blacklist/test/blacklist_test_dll_3.cc", | 282 "blacklist/test/blacklist_test_dll_3.cc", |
270 ] | 283 ] |
271 deps = [ | 284 deps = [ |
272 "//build/config/sanitizers:deps", | 285 "//build/config/sanitizers:deps", |
273 ] | 286 ] |
274 } | 287 } |
OLD | NEW |