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
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") {
25 shared_library("chrome_elf") {
33 ":chrome_elf_manifest",
35 ":chrome_elf_resources",
37 configs += [ "//build/config/win:windowed" ]
38 configs -= [ "//build/config/win:console" ]
40 "/NODEFAULTLIB:user32.lib",
41 "/DEF:" + rebase_path("chrome_elf.def"),
43 if (current_cpu == "x86") {
44 # Don"t set an x64 base address (to avoid breaking HE-ASLR).
45 ldflags += [ "/BASE:0x01c20000" ]
51 "create_file/chrome_create_file.cc",
52 "create_file/chrome_create_file.h",
63 source_set("constants") {
65 "chrome_elf_constants.cc",
66 "chrome_elf_constants.h",
70 source_set("common") {
83 source_set("breakpad") {
84 include_dirs = [ "$target_gen_dir" ]
91 "//breakpad:breakpad_handler",
92 "//chrome:version_header",
96 if (is_component_build) {
97 shared_library("chrome_redirects") {
99 "chrome_redirects_main.cc",
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" ]
114 source_set("dll_hash") {
119 "dll_hash/dll_hash.cc",
120 "dll_hash/dll_hash.h",
124 executable("dll_hash_main") {
129 "dll_hash/dll_hash_main.cc",
133 static_library("blacklist") {
135 "blacklist/blacklist.cc",
136 "blacklist/blacklist.h",
137 "blacklist/blacklist_interceptions.cc",
138 "blacklist/blacklist_interceptions.h",
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.
146 "//base:base_static",
151 test("chrome_elf_unittests") {
152 output_name = "chrome_elf_unittests"
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",
160 include_dirs = [ "$target_gen_dir" ]
163 ":blacklist_test_main_dll",
166 "//base/test:run_all_unittests",
167 "//base/test:test_support",
172 ":blacklist_test_dll_1",
173 ":blacklist_test_dll_2",
174 ":blacklist_test_dll_3",
180 shared_library("blacklist_test_main_dll") {
182 "blacklist/test/blacklist_test_main_dll.cc",
189 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def",
193 shared_library("blacklist_test_dll_1") {
195 "blacklist/test/blacklist_test_dll_1.cc",
197 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def",
201 shared_library("blacklist_test_dll_2") {
203 "blacklist/test/blacklist_test_dll_2.cc",
205 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def",
209 shared_library("blacklist_test_dll_3") {
211 "blacklist/test/blacklist_test_dll_3.cc",