Chromium Code Reviews| 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("//chrome/version.gni") | |
| 6 | |
| 7 process_version("chrome_elf_resources") { | |
| 8 source = "//chrome/app/chrome_version.rc.version" | |
| 9 output = "$target_gen_dir/chrome_elf_version.rc" | |
| 10 extra_args = [ | |
| 11 "-f", | |
| 12 rebase_path("chrome_elf.ver"), | |
| 13 ] | |
| 14 } | |
| 15 | |
| 16 shared_library("chrome_elf") { | |
| 17 sources = [ | |
| 18 "chrome_elf_main.cc", | |
| 19 "chrome_elf_main.h", | |
| 20 "$target_gen_dir/chrome_elf_version.rc", | |
| 21 ] | |
| 22 deps = [ | |
| 23 ":blacklist", | |
| 24 ":chrome_elf_breakpad", | |
| 25 ":chrome_elf_lib", | |
| 26 ":chrome_elf_resources", | |
| 27 ] | |
| 28 configs += [ "//build/config/win:windowed" ] | |
| 29 ldflags = [ | |
| 30 "/NODEFAULTLIB:user32.lib", | |
| 31 "/DEF:" + rebase_path("chrome_elf.def"), | |
| 32 ] | |
| 33 if (cpu_arch == "x86") { | |
| 34 # Don"t set an x64 base address (to avoid breaking HE-ASLR). | |
| 35 ldflags += [ "/BASE:0x01c20000" ] | |
| 36 } | |
| 37 } | |
| 38 | |
| 39 test("chrome_elf_unittests_exe") { | |
| 40 output_name = "chrome_elf_unittests" | |
| 41 sources = [ | |
| 42 "blacklist/test/blacklist_test.cc", | |
| 43 "chrome_elf_util_unittest.cc", | |
| 44 "create_file/chrome_create_file_unittest.cc", | |
| 45 "elf_imports_unittest.cc", | |
| 46 "ntdll_cache_unittest.cc", | |
| 47 ] | |
| 48 include_dirs = [ "$target_gen_dir" ] | |
| 49 deps = [ | |
| 50 ":chrome_elf_lib", | |
| 51 "//base", | |
| 52 "//base/test:run_all_unittests", | |
| 53 "//base/test:test_support", | |
| 54 "//sandbox", | |
| 55 "//testing/gtest", | |
| 56 ":blacklist", | |
| 57 ":blacklist_test_main_dll", | |
| 58 ] | |
| 59 data_deps = [ | |
| 60 ":blacklist_test_dll_1", | |
| 61 ":blacklist_test_dll_2", | |
| 62 ":blacklist_test_dll_3", | |
| 63 ] | |
| 64 } | |
| 65 | |
| 66 group("chrome_elf_unittests") { | |
| 67 testonly = true | |
| 68 | |
| 69 # A dummy target to ensure that chrome_elf.dll and chrome.exe gets built | |
| 70 # when building chrome_elf_unittests.exe without introducing an | |
| 71 # explicit runtime dependency. | |
| 72 deps = [ | |
| 73 "//chrome", | |
| 74 ":chrome_elf", | |
| 75 ":chrome_elf_unittests_exe", | |
| 76 ] | |
| 77 } | |
| 78 | |
| 79 source_set("chrome_elf_lib") { | |
| 80 sources = [ | |
| 81 "create_file/chrome_create_file.cc", | |
| 82 "create_file/chrome_create_file.h", | |
| 83 "ntdll_cache.cc", | |
| 84 "ntdll_cache.h", | |
| 85 ] | |
| 86 deps = [ | |
| 87 ":chrome_elf_common", | |
| 88 "//base:base_static", | |
| 89 "//sandbox", | |
| 90 ] | |
| 91 } | |
| 92 | |
| 93 source_set("chrome_elf_constants") { | |
| 94 sources = [ | |
| 95 "chrome_elf_constants.cc", | |
| 96 "chrome_elf_constants.h", | |
| 97 ] | |
| 98 } | |
| 99 | |
| 100 source_set("chrome_elf_common") { | |
| 101 deps = [ | |
| 102 ":chrome_elf_constants", | |
| 103 ] | |
| 104 sources = [ | |
| 105 "chrome_elf_types.h", | |
| 106 "chrome_elf_util.cc", | |
| 107 "chrome_elf_util.h", | |
| 108 "thunk_getter.cc", | |
| 109 "thunk_getter.h", | |
| 110 ] | |
| 111 } | |
| 112 | |
| 113 source_set("chrome_elf_breakpad") { | |
| 114 include_dirs = [ "$target_gen_dir" ] | |
| 115 sources = [ | |
| 116 "breakpad.cc", | |
| 117 "breakpad.h", | |
| 118 ] | |
| 119 deps = [ | |
| 120 ":chrome_elf_common", | |
| 121 "//breakpad:breakpad_handler", | |
| 122 "//chrome:version_header", | |
| 123 ] | |
| 124 } | |
| 125 | |
| 126 if (is_component_build) { | |
| 127 shared_library("chrome_redirects") { | |
| 128 sources = [ | |
| 129 "chrome_redirects_main.cc", | |
| 130 ] | |
| 131 deps = [ | |
| 132 ":chrome_elf_lib", | |
| 133 ] | |
| 134 configs += [ "//build/config/win:windowed" ] | |
| 135 ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ] | |
| 136 | |
| 137 if (cpu_arch == "x86") { | |
| 138 # Don't set an x64 base address (to avoid breaking HE-ASLR). | |
| 139 ldflags += [ "/BASE:0x01c20000" ] | |
| 140 } | |
| 141 } | |
| 142 } | |
| 143 | |
| 144 source_set("dll_hash") { | |
| 145 deps = [ | |
| 146 "//base", | |
| 147 ] | |
| 148 sources = [ | |
| 149 "dll_hash/dll_hash.cc", | |
| 150 "dll_hash/dll_hash.h", | |
| 151 ] | |
| 152 } | |
| 153 | |
| 154 executable("dll_hash_main") { | |
| 155 deps = [ | |
| 156 ":dll_hash", | |
| 157 ] | |
| 158 sources = [ | |
| 159 "dll_hash/dll_hash_main.cc", | |
| 160 ] | |
| 161 } | |
| 162 | |
| 163 static_library("blacklist") { | |
| 164 sources = [ | |
| 165 "blacklist/blacklist.cc", | |
| 166 "blacklist/blacklist.h", | |
| 167 "blacklist/blacklist_interceptions.cc", | |
| 168 "blacklist/blacklist_interceptions.h", | |
| 169 ] | |
| 170 deps = [ | |
| 171 # Depend on base_static, but do NOT take a dependency on base.gyp:base | |
| 172 # as that would risk pulling in base"s link-time dependencies which | |
| 173 # chrome_elf cannot do. | |
| 174 "//base:base_static", | |
| 175 ":chrome_elf_breakpad", | |
| 176 ":chrome_elf_constants", | |
| 177 "//sandbox:sandbox", | |
| 178 ] | |
| 179 } | |
| 180 | |
| 181 shared_library("blacklist_test_main_dll") { | |
| 182 sources = [ | |
| 183 "blacklist/test/blacklist_test_main_dll.cc", | |
| 184 ] | |
| 185 deps = [ | |
| 186 "//base", | |
| 187 ":blacklist", | |
| 188 ] | |
| 189 ldflags = | |
| 190 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def") ] | |
| 191 } | |
| 192 | |
| 193 shared_library("blacklist_test_dll_1") { | |
|
Slava Chigrin
2015/01/15 21:34:13
Not sure, whether this is correct equivalent for G
| |
| 194 sources = [ | |
| 195 "blacklist/test/blacklist_test_dll_1.cc", | |
| 196 ] | |
| 197 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def") ] | |
| 198 } | |
| 199 | |
| 200 shared_library("blacklist_test_dll_2") { | |
| 201 sources = [ | |
| 202 "blacklist/test/blacklist_test_dll_2.cc", | |
| 203 ] | |
| 204 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def") ] | |
| 205 } | |
| 206 | |
| 207 shared_library("blacklist_test_dll_3") { | |
| 208 sources = [ | |
| 209 "blacklist/test/blacklist_test_dll_3.cc", | |
| 210 ] | |
| 211 } | |
| OLD | NEW |