Index: chrome_elf/BUILD.gn |
diff --git a/chrome_elf/BUILD.gn b/chrome_elf/BUILD.gn |
index 9e97c5a3c193b2ebbc37f3998fe068aacec63318..54ee743eec3b0d893c21b134e07b39dc4e867806 100644 |
--- a/chrome_elf/BUILD.gn |
+++ b/chrome_elf/BUILD.gn |
@@ -2,10 +2,17 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+# Chrome elf targets (excepting tests) should only link in kernel32. |
+# Please don't add dependencies on any other system libraries. |
+ |
import("//build/config/win/manifest.gni") |
import("//chrome/version.gni") |
import("//testing/test.gni") |
+##------------------------------------------------------------------------------ |
+## chrome_elf |
+##------------------------------------------------------------------------------ |
+ |
process_version("chrome_elf_resources") { |
template_file = chrome_version_rc_template |
sources = [ |
@@ -33,9 +40,10 @@ shared_library("chrome_elf") { |
":breakpad", |
":chrome_elf_manifest", |
":chrome_elf_resources", |
- ":common", |
+ ":hook_util", |
"//build/config/sanitizers:deps", |
"//chrome/install_static:install_static_util", |
+ "//chrome_elf/nt_registry:nt_registry", |
] |
configs += [ "//build/config/win:windowed" ] |
configs -= [ "//build/config/win:console" ] |
@@ -46,6 +54,10 @@ shared_library("chrome_elf") { |
} |
} |
+##------------------------------------------------------------------------------ |
+## source sets |
+##------------------------------------------------------------------------------ |
+ |
source_set("constants") { |
sources = [ |
"chrome_elf_constants.cc", |
@@ -53,35 +65,6 @@ source_set("constants") { |
] |
} |
-source_set("common") { |
- public_deps = [ |
- ":constants", |
- ] |
- deps = [ |
- "//base", |
- "//sandbox", |
- ] |
- sources = [ |
- "thunk_getter.cc", |
- "thunk_getter.h", |
- ] |
-} |
- |
-source_set("breakpad") { |
- include_dirs = [ "$target_gen_dir" ] |
- sources = [ |
- "breakpad.cc", |
- "breakpad.h", |
- ] |
- deps = [ |
- ":common", |
- "//base", |
- "//breakpad:breakpad_handler", |
- "//chrome/common:version_header", |
- "//chrome/install_static:install_static_util", |
- ] |
-} |
- |
source_set("dll_hash") { |
deps = [ |
"//base", |
@@ -92,6 +75,10 @@ source_set("dll_hash") { |
] |
} |
+##------------------------------------------------------------------------------ |
+## chrome_elf sub targets |
+##------------------------------------------------------------------------------ |
+ |
executable("dll_hash_main") { |
sources = [ |
"dll_hash/dll_hash_main.cc", |
@@ -115,13 +102,44 @@ static_library("blacklist") { |
] |
deps = [ |
":breakpad", |
- ":common", |
":constants", |
+ ":hook_util", |
+ "//chrome/install_static:install_static_util", |
+ "//chrome_elf/nt_registry:nt_registry", |
+ |
+ # Still uses base/win/pe_image.h |
"//base", |
+ ] |
+} |
+ |
+static_library("breakpad") { |
+ include_dirs = [ "$target_gen_dir" ] |
+ sources = [ |
+ "breakpad/breakpad.cc", |
+ "breakpad/breakpad.h", |
+ ] |
+ deps = [ |
+ "//breakpad:breakpad_handler", |
+ "//chrome/common:version_header", |
"//chrome/install_static:install_static_util", |
+ "//chrome_elf/nt_registry:nt_registry", |
] |
} |
+static_library("hook_util") { |
+ sources = [ |
+ "hook_util/thunk_getter.cc", |
+ "hook_util/thunk_getter.h", |
+ ] |
+ deps = [ |
+ "//sandbox", |
+ ] |
+} |
+ |
+##------------------------------------------------------------------------------ |
+## tests |
+##------------------------------------------------------------------------------ |
+ |
test("chrome_elf_unittests") { |
output_name = "chrome_elf_unittests" |
sources = [ |
@@ -133,13 +151,15 @@ test("chrome_elf_unittests") { |
deps = [ |
":blacklist", |
":blacklist_test_main_dll", |
- ":common", |
+ ":constants", |
+ ":hook_util", |
"//base", |
"//base/test:run_all_unittests", |
"//base/test:test_support", |
"//chrome", |
"//chrome/common:version_header", |
"//chrome/install_static:install_static_util", |
+ "//chrome_elf/nt_registry:nt_registry", |
"//sandbox", |
"//testing/gtest", |
] |
@@ -166,10 +186,10 @@ shared_library("blacklist_test_main_dll") { |
] |
deps = [ |
":blacklist", |
- ":common", |
"//base", |
"//build/config/sanitizers:deps", |
"//chrome/install_static:install_static_util", |
+ "//chrome_elf/nt_registry:nt_registry", |
] |
} |