OLD | NEW |
---|---|
(Empty) | |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 import("//chrome/version.gni") | |
6 import("//testing/test.gni") | |
7 | |
8 process_version("chrome_elf_resources") { | |
9 source = "//chrome/app/chrome_version.rc.version" | |
10 output = "$target_gen_dir/chrome_elf_version.rc" | |
11 extra_args = [ | |
12 "-f", | |
13 rebase_path("chrome_elf.ver"), | |
14 ] | |
15 } | |
16 | |
17 shared_library("chrome_elf") { | |
18 sources = [ | |
19 "chrome_elf_main.cc", | |
20 "chrome_elf_main.h", | |
21 "$target_gen_dir/chrome_elf_version.rc", | |
22 ] | |
23 deps = [ | |
24 ":blacklist", | |
25 ":chrome_elf_breakpad", | |
26 ":chrome_elf_lib", | |
27 ":chrome_elf_resources", | |
28 ] | |
29 configs += [ "//build/config/win:windowed" ] | |
brettw
2015/01/22 20:12:10
I think you'll also need to do
configs -= [ "//b
Slava Chigrin
2015/01/22 22:06:00
Done.
| |
30 ldflags = [ | |
31 "/NODEFAULTLIB:user32.lib", | |
32 "/DEF:" + rebase_path("chrome_elf.def"), | |
33 ] | |
34 if (cpu_arch == "x86") { | |
35 # Don"t set an x64 base address (to avoid breaking HE-ASLR). | |
36 ldflags += [ "/BASE:0x01c20000" ] | |
37 } | |
38 } | |
39 | |
40 source_set("chrome_elf_lib") { | |
brettw
2015/01/22 20:12:10
I would normally not duplicate the directory name
Slava Chigrin
2015/01/22 22:06:00
Done.
| |
41 sources = [ | |
42 "create_file/chrome_create_file.cc", | |
43 "create_file/chrome_create_file.h", | |
44 "ntdll_cache.cc", | |
45 "ntdll_cache.h", | |
46 ] | |
47 deps = [ | |
48 ":chrome_elf_common", | |
49 "//base:base_static", | |
50 "//sandbox", | |
51 ] | |
52 } | |
53 | |
54 source_set("chrome_elf_constants") { | |
55 sources = [ | |
56 "chrome_elf_constants.cc", | |
57 "chrome_elf_constants.h", | |
58 ] | |
59 } | |
60 | |
61 source_set("chrome_elf_common") { | |
62 deps = [ | |
63 ":chrome_elf_constants", | |
64 ] | |
65 sources = [ | |
66 "chrome_elf_types.h", | |
67 "chrome_elf_util.cc", | |
68 "chrome_elf_util.h", | |
69 "thunk_getter.cc", | |
70 "thunk_getter.h", | |
71 ] | |
72 } | |
73 | |
74 source_set("chrome_elf_breakpad") { | |
75 include_dirs = [ "$target_gen_dir" ] | |
76 sources = [ | |
77 "breakpad.cc", | |
78 "breakpad.h", | |
79 ] | |
80 deps = [ | |
81 ":chrome_elf_common", | |
82 "//breakpad:breakpad_handler", | |
83 "//chrome:version_header", | |
84 ] | |
85 } | |
86 | |
87 if (is_component_build) { | |
88 shared_library("chrome_redirects") { | |
89 sources = [ | |
90 "chrome_redirects_main.cc", | |
91 ] | |
92 deps = [ | |
93 ":chrome_elf_lib", | |
94 ] | |
95 configs += [ "//build/config/win:windowed" ] | |
96 ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ] | |
97 | |
98 if (cpu_arch == "x86") { | |
99 # Don't set an x64 base address (to avoid breaking HE-ASLR). | |
100 ldflags += [ "/BASE:0x01c20000" ] | |
101 } | |
102 } | |
103 } | |
104 | |
105 source_set("dll_hash") { | |
106 deps = [ | |
107 "//base", | |
108 ] | |
109 sources = [ | |
110 "dll_hash/dll_hash.cc", | |
111 "dll_hash/dll_hash.h", | |
112 ] | |
113 } | |
114 | |
115 executable("dll_hash_main") { | |
116 deps = [ | |
117 ":dll_hash", | |
118 ] | |
119 sources = [ | |
120 "dll_hash/dll_hash_main.cc", | |
121 ] | |
122 } | |
123 | |
124 static_library("blacklist") { | |
125 sources = [ | |
126 "blacklist/blacklist.cc", | |
127 "blacklist/blacklist.h", | |
128 "blacklist/blacklist_interceptions.cc", | |
129 "blacklist/blacklist_interceptions.h", | |
130 ] | |
131 deps = [ | |
132 # Depend on base_static, but do NOT take a dependency on base.gyp:base | |
133 # as that would risk pulling in base's link-time dependencies which | |
134 # chrome_elf cannot do. | |
135 "//base:base_static", | |
136 ":chrome_elf_breakpad", | |
137 ":chrome_elf_constants", | |
138 "//sandbox:sandbox", | |
139 ] | |
140 } | |
141 | |
142 test("chrome_elf_unittests_exe") { | |
143 output_name = "chrome_elf_unittests" | |
144 sources = [ | |
145 "blacklist/test/blacklist_test.cc", | |
146 "chrome_elf_util_unittest.cc", | |
147 "create_file/chrome_create_file_unittest.cc", | |
148 "elf_imports_unittest.cc", | |
149 "ntdll_cache_unittest.cc", | |
150 ] | |
151 include_dirs = [ "$target_gen_dir" ] | |
152 deps = [ | |
153 ":chrome_elf_lib", | |
154 "//base", | |
155 "//base/test:run_all_unittests", | |
156 "//base/test:test_support", | |
157 "//sandbox", | |
158 "//testing/gtest", | |
159 ":blacklist", | |
160 ":blacklist_test_main_dll", | |
161 ] | |
162 data_deps = [ | |
163 ":blacklist_test_dll_1", | |
164 ":blacklist_test_dll_2", | |
165 ":blacklist_test_dll_3", | |
166 ] | |
167 } | |
168 | |
169 group("chrome_elf_unittests") { | |
brettw
2015/01/22 20:12:10
GN can do this better which will let us clean up t
Slava Chigrin
2015/01/22 22:06:00
Done.
| |
170 testonly = true | |
171 | |
172 # A dummy target to ensure that chrome_elf.dll and chrome.exe gets built | |
173 # when building chrome_elf_unittests.exe without introducing an | |
174 # explicit runtime dependency. | |
175 deps = [ | |
176 "//chrome", | |
177 ":chrome_elf", | |
178 ":chrome_elf_unittests_exe", | |
179 ] | |
180 } | |
181 | |
182 shared_library("blacklist_test_main_dll") { | |
183 sources = [ | |
184 "blacklist/test/blacklist_test_main_dll.cc", | |
185 ] | |
186 deps = [ | |
187 "//base", | |
188 ":blacklist", | |
189 ] | |
190 ldflags = | |
191 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def") ] | |
brettw
2015/01/22 20:12:10
I usually add the second parameter to rebase path:
Slava Chigrin
2015/01/22 22:06:00
Done.
| |
192 } | |
193 | |
194 shared_library("blacklist_test_dll_1") { | |
195 sources = [ | |
196 "blacklist/test/blacklist_test_dll_1.cc", | |
197 ] | |
198 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def") ] | |
199 } | |
200 | |
201 shared_library("blacklist_test_dll_2") { | |
202 sources = [ | |
203 "blacklist/test/blacklist_test_dll_2.cc", | |
204 ] | |
205 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def") ] | |
206 } | |
207 | |
208 shared_library("blacklist_test_dll_3") { | |
209 sources = [ | |
210 "blacklist/test/blacklist_test_dll_3.cc", | |
211 ] | |
212 } | |
OLD | NEW |