Update V8 to version 4.7.15.
[chromium-blink-merge.git] / chrome_elf / BUILD.gn
blob2a15a554843878d88fbb8ed7a26ab58d617e9ba8
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.
5 import("//build/config/win/manifest.gni")
6 import("//chrome/version.gni")
7 import("//testing/test.gni")
9 process_version("chrome_elf_resources") {
10   template_file = chrome_version_rc_template
11   sources = [
12     "chrome_elf.ver",
13   ]
14   output = "$target_gen_dir/chrome_elf_version.rc"
17 # This manifest matches what GYP produces. It may not even be necessary.
18 windows_manifest("chrome_elf_manifest") {
19   sources = [
20     as_invoker_manifest,
21   ]
22   type = "dll"
25 shared_library("chrome_elf") {
26   sources = [
27     "chrome_elf_main.cc",
28     "chrome_elf_main.h",
29   ]
30   deps = [
31     ":blacklist",
32     ":breakpad",
33     ":chrome_elf_manifest",
34     ":lib",
35     ":chrome_elf_resources",
36   ]
37   configs += [ "//build/config/win:windowed" ]
38   configs -= [ "//build/config/win:console" ]
39   ldflags = [
40     "/NODEFAULTLIB:user32.lib",
41     "/DEF:" + rebase_path("chrome_elf.def"),
42   ]
43   if (current_cpu == "x86") {
44     # Don"t set an x64 base address (to avoid breaking HE-ASLR).
45     ldflags += [ "/BASE:0x01c20000" ]
46   }
49 source_set("lib") {
50   sources = [
51     "create_file/chrome_create_file.cc",
52     "create_file/chrome_create_file.h",
53     "ntdll_cache.cc",
54     "ntdll_cache.h",
55   ]
56   deps = [
57     ":common",
58     "//base:base_static",
59     "//sandbox",
60   ]
63 source_set("constants") {
64   sources = [
65     "chrome_elf_constants.cc",
66     "chrome_elf_constants.h",
67   ]
70 source_set("common") {
71   deps = [
72     ":constants",
73   ]
74   sources = [
75     "chrome_elf_types.h",
76     "chrome_elf_util.cc",
77     "chrome_elf_util.h",
78     "thunk_getter.cc",
79     "thunk_getter.h",
80   ]
83 source_set("breakpad") {
84   include_dirs = [ "$target_gen_dir" ]
85   sources = [
86     "breakpad.cc",
87     "breakpad.h",
88   ]
89   deps = [
90     ":common",
91     "//breakpad:breakpad_handler",
92     "//chrome:version_header",
93   ]
96 if (is_component_build) {
97   shared_library("chrome_redirects") {
98     sources = [
99       "chrome_redirects_main.cc",
100     ]
101     deps = [
102       ":lib",
103     ]
104     configs += [ "//build/config/win:windowed" ]
105     ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ]
107     if (current_cpu == "x86") {
108       # Don't set an x64 base address (to avoid breaking HE-ASLR).
109       ldflags += [ "/BASE:0x01c20000" ]
110     }
111   }
114 source_set("dll_hash") {
115   deps = [
116     "//base",
117   ]
118   sources = [
119     "dll_hash/dll_hash.cc",
120     "dll_hash/dll_hash.h",
121   ]
124 executable("dll_hash_main") {
125   deps = [
126     ":dll_hash",
127   ]
128   sources = [
129     "dll_hash/dll_hash_main.cc",
130   ]
133 static_library("blacklist") {
134   sources = [
135     "blacklist/blacklist.cc",
136     "blacklist/blacklist.h",
137     "blacklist/blacklist_interceptions.cc",
138     "blacklist/blacklist_interceptions.h",
139   ]
140   deps = [
141     # Depend on base_static, but do NOT take a dependency on base.gyp:base
142     # as that would risk pulling in base's link-time dependencies which
143     # chrome_elf cannot do.
144     ":breakpad",
145     ":constants",
146     "//base:base_static",
147     "//sandbox:sandbox",
148   ]
151 test("chrome_elf_unittests") {
152   output_name = "chrome_elf_unittests"
153   sources = [
154     "blacklist/test/blacklist_test.cc",
155     "chrome_elf_util_unittest.cc",
156     "create_file/chrome_create_file_unittest.cc",
157     "elf_imports_unittest.cc",
158     "ntdll_cache_unittest.cc",
159   ]
160   include_dirs = [ "$target_gen_dir" ]
161   deps = [
162     ":blacklist",
163     ":blacklist_test_main_dll",
164     ":lib",
165     "//base",
166     "//base/test:run_all_unittests",
167     "//base/test:test_support",
168     "//sandbox",
169     "//testing/gtest",
170   ]
171   data_deps = [
172     ":blacklist_test_dll_1",
173     ":blacklist_test_dll_2",
174     ":blacklist_test_dll_3",
175     ":chrome_elf",
176     "//chrome",
177   ]
180 shared_library("blacklist_test_main_dll") {
181   sources = [
182     "blacklist/test/blacklist_test_main_dll.cc",
183   ]
184   deps = [
185     "//base",
186     ":blacklist",
187   ]
188   ldflags =
189       [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def",
190                               root_build_dir) ]
193 shared_library("blacklist_test_dll_1") {
194   sources = [
195     "blacklist/test/blacklist_test_dll_1.cc",
196   ]
197   ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def",
198                                     root_build_dir) ]
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                                     root_build_dir) ]
209 shared_library("blacklist_test_dll_3") {
210   sources = [
211     "blacklist/test/blacklist_test_dll_3.cc",
212   ]