| 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("//build/config/win/manifest.gni") | |
| 6 import("//chrome/version.gni") | |
| 7 import("//testing/test.gni") | |
| 8 | |
| 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" | |
| 15 } | |
| 16 | |
| 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" | |
| 23 } | |
| 24 | |
| 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 ":chrome_elf_resources", | |
| 35 ":common", | |
| 36 "//build/config/sanitizers:deps", | |
| 37 ] | |
| 38 configs += [ "//build/config/win:windowed" ] | |
| 39 configs -= [ "//build/config/win:console" ] | |
| 40 ldflags = [ | |
| 41 "/NODEFAULTLIB:user32.lib", | |
| 42 "/DEF:" + rebase_path("chrome_elf.def"), | |
| 43 ] | |
| 44 if (current_cpu == "x86") { | |
| 45 # Don"t set an x64 base address (to avoid breaking HE-ASLR). | |
| 46 ldflags += [ "/BASE:0x01c20000" ] | |
| 47 } | |
| 48 } | |
| 49 | |
| 50 source_set("constants") { | |
| 51 sources = [ | |
| 52 "chrome_elf_constants.cc", | |
| 53 "chrome_elf_constants.h", | |
| 54 ] | |
| 55 } | |
| 56 | |
| 57 source_set("common") { | |
| 58 public_deps = [ | |
| 59 ":constants", | |
| 60 ] | |
| 61 deps = [ | |
| 62 "//base", | |
| 63 "//sandbox", | |
| 64 ] | |
| 65 sources = [ | |
| 66 "chrome_elf_util.cc", | |
| 67 "chrome_elf_util.h", | |
| 68 "thunk_getter.cc", | |
| 69 "thunk_getter.h", | |
| 70 ] | |
| 71 } | |
| 72 | |
| 73 source_set("breakpad") { | |
| 74 include_dirs = [ "$target_gen_dir" ] | |
| 75 sources = [ | |
| 76 "breakpad.cc", | |
| 77 "breakpad.h", | |
| 78 ] | |
| 79 deps = [ | |
| 80 ":common", | |
| 81 "//base", | |
| 82 "//breakpad:breakpad_handler", | |
| 83 "//chrome/common:version_header", | |
| 84 ] | |
| 85 } | |
| 86 | |
| 87 source_set("dll_hash") { | |
| 88 deps = [ | |
| 89 "//base", | |
| 90 ] | |
| 91 sources = [ | |
| 92 "dll_hash/dll_hash.cc", | |
| 93 "dll_hash/dll_hash.h", | |
| 94 ] | |
| 95 } | |
| 96 | |
| 97 executable("dll_hash_main") { | |
| 98 sources = [ | |
| 99 "dll_hash/dll_hash_main.cc", | |
| 100 ] | |
| 101 deps = [ | |
| 102 ":dll_hash", | |
| 103 "//build/config/sanitizers:deps", | |
| 104 ] | |
| 105 } | |
| 106 | |
| 107 static_library("blacklist") { | |
| 108 sources = [ | |
| 109 "blacklist/blacklist.cc", | |
| 110 "blacklist/blacklist.h", | |
| 111 "blacklist/blacklist_interceptions.cc", | |
| 112 "blacklist/blacklist_interceptions.h", | |
| 113 ] | |
| 114 public_deps = [ | |
| 115 "//sandbox", | |
| 116 ] | |
| 117 deps = [ | |
| 118 ":breakpad", | |
| 119 ":common", | |
| 120 ":constants", | |
| 121 "//base", | |
| 122 ] | |
| 123 } | |
| 124 | |
| 125 test("chrome_elf_unittests") { | |
| 126 output_name = "chrome_elf_unittests" | |
| 127 sources = [ | |
| 128 "blacklist/test/blacklist_test.cc", | |
| 129 "chrome_elf_util_unittest.cc", | |
| 130 "elf_imports_unittest.cc", | |
| 131 ] | |
| 132 include_dirs = [ "$target_gen_dir" ] | |
| 133 deps = [ | |
| 134 ":blacklist", | |
| 135 ":blacklist_test_main_dll", | |
| 136 ":common", | |
| 137 "//base", | |
| 138 "//base/test:run_all_unittests", | |
| 139 "//base/test:test_support", | |
| 140 "//chrome", | |
| 141 "//chrome/common:version_header", | |
| 142 "//sandbox", | |
| 143 "//testing/gtest", | |
| 144 ] | |
| 145 | |
| 146 # It's not easily possible to have //chrome in data_deps without changing | |
| 147 # the //chrome target to bundle up both initial/chrome.exe and chrome.exe. | |
| 148 # As a workaround, explicitly include a data dep on just chrome.exe, and | |
| 149 # add //chrome to deps above to make sure it's been built. | |
| 150 data = [ | |
| 151 "$root_out_dir/chrome.exe", | |
| 152 ] | |
| 153 data_deps = [ | |
| 154 ":blacklist_test_dll_1", | |
| 155 ":blacklist_test_dll_2", | |
| 156 ":blacklist_test_dll_3", | |
| 157 ":chrome_elf", | |
| 158 ] | |
| 159 } | |
| 160 | |
| 161 shared_library("blacklist_test_main_dll") { | |
| 162 sources = [ | |
| 163 "blacklist/test/blacklist_test_main_dll.cc", | |
| 164 ] | |
| 165 deps = [ | |
| 166 ":blacklist", | |
| 167 ":common", | |
| 168 "//base", | |
| 169 "//build/config/sanitizers:deps", | |
| 170 ] | |
| 171 ldflags = | |
| 172 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def", | |
| 173 root_build_dir) ] | |
| 174 } | |
| 175 | |
| 176 shared_library("blacklist_test_dll_1") { | |
| 177 sources = [ | |
| 178 "blacklist/test/blacklist_test_dll_1.cc", | |
| 179 ] | |
| 180 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def", | |
| 181 root_build_dir) ] | |
| 182 deps = [ | |
| 183 "//build/config/sanitizers:deps", | |
| 184 ] | |
| 185 } | |
| 186 | |
| 187 shared_library("blacklist_test_dll_2") { | |
| 188 sources = [ | |
| 189 "blacklist/test/blacklist_test_dll_2.cc", | |
| 190 ] | |
| 191 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def", | |
| 192 root_build_dir) ] | |
| 193 deps = [ | |
| 194 "//build/config/sanitizers:deps", | |
| 195 ] | |
| 196 } | |
| 197 | |
| 198 shared_library("blacklist_test_dll_3") { | |
| 199 sources = [ | |
| 200 "blacklist/test/blacklist_test_dll_3.cc", | |
| 201 ] | |
| 202 deps = [ | |
| 203 "//build/config/sanitizers:deps", | |
| 204 ] | |
| 205 } | |
| OLD | NEW |