| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/win/manifest.gni") | 5 import("//build/config/win/manifest.gni") |
| 6 import("//chrome/version.gni") | 6 import("//chrome/version.gni") |
| 7 import("//testing/test.gni") | 7 import("//testing/test.gni") |
| 8 | 8 |
| 9 process_version("chrome_elf_resources") { | 9 process_version("chrome_elf_resources") { |
| 10 template_file = chrome_version_rc_template | 10 template_file = chrome_version_rc_template |
| 11 sources = [ | 11 sources = [ |
| 12 "chrome_elf.ver", | 12 "chrome_elf.ver", |
| 13 ] | 13 ] |
| 14 output = "$target_gen_dir/chrome_elf_version.rc" | 14 output = "$target_gen_dir/chrome_elf_version.rc" |
| 15 } | 15 } |
| 16 | 16 |
| 17 # This manifest matches what GYP produces. It may not even be necessary. | 17 # This manifest matches what GYP produces. It may not even be necessary. |
| 18 windows_manifest("chrome_elf_manifest") { | 18 windows_manifest("chrome_elf_manifest") { |
| 19 sources = [ | 19 sources = [ |
| 20 as_invoker_manifest, | 20 as_invoker_manifest, |
| 21 ] | 21 ] |
| 22 type = "dll" | 22 type = "dll" |
| 23 } | 23 } |
| 24 | 24 |
| 25 shared_library("chrome_elf") { | 25 shared_library("chrome_elf") { |
| 26 sources = [ | 26 sources = [ |
| 27 "chrome_elf.def", |
| 27 "chrome_elf_main.cc", | 28 "chrome_elf_main.cc", |
| 28 "chrome_elf_main.h", | 29 "chrome_elf_main.h", |
| 29 ] | 30 ] |
| 30 deps = [ | 31 deps = [ |
| 31 ":blacklist", | 32 ":blacklist", |
| 32 ":breakpad", | 33 ":breakpad", |
| 33 ":chrome_elf_manifest", | 34 ":chrome_elf_manifest", |
| 34 ":chrome_elf_resources", | 35 ":chrome_elf_resources", |
| 35 ":common", | 36 ":common", |
| 36 "//build/config/sanitizers:deps", | 37 "//build/config/sanitizers:deps", |
| 37 ] | 38 ] |
| 38 configs += [ "//build/config/win:windowed" ] | 39 configs += [ "//build/config/win:windowed" ] |
| 39 configs -= [ "//build/config/win:console" ] | 40 configs -= [ "//build/config/win:console" ] |
| 40 ldflags = [ | 41 ldflags = [ "/NODEFAULTLIB:user32.lib" ] |
| 41 "/NODEFAULTLIB:user32.lib", | |
| 42 "/DEF:" + rebase_path("chrome_elf.def"), | |
| 43 ] | |
| 44 if (current_cpu == "x86") { | 42 if (current_cpu == "x86") { |
| 45 # Don"t set an x64 base address (to avoid breaking HE-ASLR). | 43 # Don"t set an x64 base address (to avoid breaking HE-ASLR). |
| 46 ldflags += [ "/BASE:0x01c20000" ] | 44 ldflags += [ "/BASE:0x01c20000" ] |
| 47 } | 45 } |
| 48 } | 46 } |
| 49 | 47 |
| 50 source_set("constants") { | 48 source_set("constants") { |
| 51 sources = [ | 49 sources = [ |
| 52 "chrome_elf_constants.cc", | 50 "chrome_elf_constants.cc", |
| 53 "chrome_elf_constants.h", | 51 "chrome_elf_constants.h", |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 ":blacklist_test_dll_1", | 152 ":blacklist_test_dll_1", |
| 155 ":blacklist_test_dll_2", | 153 ":blacklist_test_dll_2", |
| 156 ":blacklist_test_dll_3", | 154 ":blacklist_test_dll_3", |
| 157 ":chrome_elf", | 155 ":chrome_elf", |
| 158 ] | 156 ] |
| 159 } | 157 } |
| 160 | 158 |
| 161 shared_library("blacklist_test_main_dll") { | 159 shared_library("blacklist_test_main_dll") { |
| 162 sources = [ | 160 sources = [ |
| 163 "blacklist/test/blacklist_test_main_dll.cc", | 161 "blacklist/test/blacklist_test_main_dll.cc", |
| 162 "blacklist/test/blacklist_test_main_dll.def", |
| 164 ] | 163 ] |
| 165 deps = [ | 164 deps = [ |
| 166 ":blacklist", | 165 ":blacklist", |
| 167 ":common", | 166 ":common", |
| 168 "//base", | 167 "//base", |
| 169 "//build/config/sanitizers:deps", | 168 "//build/config/sanitizers:deps", |
| 170 ] | 169 ] |
| 171 ldflags = | |
| 172 [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def", | |
| 173 root_build_dir) ] | |
| 174 } | 170 } |
| 175 | 171 |
| 176 shared_library("blacklist_test_dll_1") { | 172 loadable_module("blacklist_test_dll_1") { |
| 177 sources = [ | 173 sources = [ |
| 178 "blacklist/test/blacklist_test_dll_1.cc", | 174 "blacklist/test/blacklist_test_dll_1.cc", |
| 175 "blacklist/test/blacklist_test_dll_1.def", |
| 179 ] | 176 ] |
| 180 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def", | |
| 181 root_build_dir) ] | |
| 182 deps = [ | 177 deps = [ |
| 183 "//build/config/sanitizers:deps", | 178 "//build/config/sanitizers:deps", |
| 184 ] | 179 ] |
| 185 } | 180 } |
| 186 | 181 |
| 187 shared_library("blacklist_test_dll_2") { | 182 loadable_module("blacklist_test_dll_2") { |
| 188 sources = [ | 183 sources = [ |
| 189 "blacklist/test/blacklist_test_dll_2.cc", | 184 "blacklist/test/blacklist_test_dll_2.cc", |
| 185 "blacklist/test/blacklist_test_dll_2.def", |
| 190 ] | 186 ] |
| 191 ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def", | |
| 192 root_build_dir) ] | |
| 193 deps = [ | 187 deps = [ |
| 194 "//build/config/sanitizers:deps", | 188 "//build/config/sanitizers:deps", |
| 195 ] | 189 ] |
| 196 } | 190 } |
| 197 | 191 |
| 198 shared_library("blacklist_test_dll_3") { | 192 # As-is, this does not generate a .lib file because there are no exports and no |
| 193 # .def file. The current definition of loadable_module does not declare a .lib |
| 194 # file as an output, so this is OK. If it did (or if this used shared_library |
| 195 # which does), Ninja would get confused and always rebuild this target because |
| 196 # it sees a declared output file but that file doesn't exist on disk. |
| 197 loadable_module("blacklist_test_dll_3") { |
| 199 sources = [ | 198 sources = [ |
| 200 "blacklist/test/blacklist_test_dll_3.cc", | 199 "blacklist/test/blacklist_test_dll_3.cc", |
| 201 ] | 200 ] |
| 202 deps = [ | 201 deps = [ |
| 203 "//build/config/sanitizers:deps", | 202 "//build/config/sanitizers:deps", |
| 204 ] | 203 ] |
| 205 } | 204 } |
| OLD | NEW |