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("//chrome/version.gni")
6 import("//testing/test.gni")
8 process_version("chrome_elf_resources") {
9 source = "//chrome/app/chrome_version.rc.version"
10 output = "$target_gen_dir/chrome_elf_version.rc"
13 rebase_path("chrome_elf.ver"),
17 shared_library("chrome_elf") {
21 "$target_gen_dir/chrome_elf_version.rc",
27 ":chrome_elf_resources",
29 configs += [ "//build/config/win:windowed" ]
30 configs -= [ "//build/config/win:console" ]
32 "/NODEFAULTLIB:user32.lib",
33 "/DEF:" + rebase_path("chrome_elf.def"),
35 if (cpu_arch == "x86") {
36 # Don"t set an x64 base address (to avoid breaking HE-ASLR).
37 ldflags += [ "/BASE:0x01c20000" ]
43 "create_file/chrome_create_file.cc",
44 "create_file/chrome_create_file.h",
55 source_set("constants") {
57 "chrome_elf_constants.cc",
58 "chrome_elf_constants.h",
62 source_set("common") {
75 source_set("breakpad") {
76 include_dirs = [ "$target_gen_dir" ]
83 "//breakpad:breakpad_handler",
84 "//chrome:version_header",
88 if (is_component_build) {
89 shared_library("chrome_redirects") {
91 "chrome_redirects_main.cc",
96 configs += [ "//build/config/win:windowed" ]
97 ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ]
99 if (cpu_arch == "x86") {
100 # Don't set an x64 base address (to avoid breaking HE-ASLR).
101 ldflags += [ "/BASE:0x01c20000" ]
106 source_set("dll_hash") {
111 "dll_hash/dll_hash.cc",
112 "dll_hash/dll_hash.h",
116 executable("dll_hash_main") {
121 "dll_hash/dll_hash_main.cc",
125 static_library("blacklist") {
127 "blacklist/blacklist.cc",
128 "blacklist/blacklist.h",
129 "blacklist/blacklist_interceptions.cc",
130 "blacklist/blacklist_interceptions.h",
133 # Depend on base_static, but do NOT take a dependency on base.gyp:base
134 # as that would risk pulling in base's link-time dependencies which
135 # chrome_elf cannot do.
138 "//base:base_static",
143 test("chrome_elf_unittests") {
144 output_name = "chrome_elf_unittests"
146 "blacklist/test/blacklist_test.cc",
147 "chrome_elf_util_unittest.cc",
148 "create_file/chrome_create_file_unittest.cc",
149 "elf_imports_unittest.cc",
150 "ntdll_cache_unittest.cc",
152 include_dirs = [ "$target_gen_dir" ]
155 ":blacklist_test_main_dll",
158 "//base/test:run_all_unittests",
159 "//base/test:test_support",
164 ":blacklist_test_dll_1",
165 ":blacklist_test_dll_2",
166 ":blacklist_test_dll_3",
172 shared_library("blacklist_test_main_dll") {
174 "blacklist/test/blacklist_test_main_dll.cc",
181 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def",
185 shared_library("blacklist_test_dll_1") {
187 "blacklist/test/blacklist_test_dll_1.cc",
189 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def",
193 shared_library("blacklist_test_dll_2") {
195 "blacklist/test/blacklist_test_dll_2.cc",
197 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def",
201 shared_library("blacklist_test_dll_3") {
203 "blacklist/test/blacklist_test_dll_3.cc",