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") {
13 output = "$target_gen_dir/chrome_elf_version.rc"
16 # This manifest matches what GYP produces. It may not even be necessary.
17 windows_manifest("chrome_elf_manifest") {
24 shared_library("chrome_elf") {
32 ":chrome_elf_manifest",
34 ":chrome_elf_resources",
36 configs += [ "//build/config/win:windowed" ]
37 configs -= [ "//build/config/win:console" ]
39 "/NODEFAULTLIB:user32.lib",
40 "/DEF:" + rebase_path("chrome_elf.def"),
42 if (current_cpu == "x86") {
43 # Don"t set an x64 base address (to avoid breaking HE-ASLR).
44 ldflags += [ "/BASE:0x01c20000" ]
50 "create_file/chrome_create_file.cc",
51 "create_file/chrome_create_file.h",
62 source_set("constants") {
64 "chrome_elf_constants.cc",
65 "chrome_elf_constants.h",
69 source_set("common") {
82 source_set("breakpad") {
83 include_dirs = [ "$target_gen_dir" ]
90 "//breakpad:breakpad_handler",
91 "//chrome:version_header",
95 if (is_component_build) {
96 shared_library("chrome_redirects") {
98 "chrome_redirects_main.cc",
103 configs += [ "//build/config/win:windowed" ]
104 ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ]
106 if (current_cpu == "x86") {
107 # Don't set an x64 base address (to avoid breaking HE-ASLR).
108 ldflags += [ "/BASE:0x01c20000" ]
113 source_set("dll_hash") {
118 "dll_hash/dll_hash.cc",
119 "dll_hash/dll_hash.h",
123 executable("dll_hash_main") {
128 "dll_hash/dll_hash_main.cc",
132 static_library("blacklist") {
134 "blacklist/blacklist.cc",
135 "blacklist/blacklist.h",
136 "blacklist/blacklist_interceptions.cc",
137 "blacklist/blacklist_interceptions.h",
140 # Depend on base_static, but do NOT take a dependency on base.gyp:base
141 # as that would risk pulling in base's link-time dependencies which
142 # chrome_elf cannot do.
145 "//base:base_static",
150 test("chrome_elf_unittests") {
151 output_name = "chrome_elf_unittests"
153 "blacklist/test/blacklist_test.cc",
154 "chrome_elf_util_unittest.cc",
155 "create_file/chrome_create_file_unittest.cc",
156 "elf_imports_unittest.cc",
157 "ntdll_cache_unittest.cc",
159 include_dirs = [ "$target_gen_dir" ]
162 ":blacklist_test_main_dll",
165 "//base/test:run_all_unittests",
166 "//base/test:test_support",
171 ":blacklist_test_dll_1",
172 ":blacklist_test_dll_2",
173 ":blacklist_test_dll_3",
179 shared_library("blacklist_test_main_dll") {
181 "blacklist/test/blacklist_test_main_dll.cc",
188 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def",
192 shared_library("blacklist_test_dll_1") {
194 "blacklist/test/blacklist_test_dll_1.cc",
196 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def",
200 shared_library("blacklist_test_dll_2") {
202 "blacklist/test/blacklist_test_dll_2.cc",
204 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def",
208 shared_library("blacklist_test_dll_3") {
210 "blacklist/test/blacklist_test_dll_3.cc",