Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5966)

Unified Diff: chrome_elf/BUILD.gn

Issue 832583007: Add GN files for chrome_elf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add test.gni import. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« build/config/compiler/BUILD.gn ('K') | « chrome/renderer/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/BUILD.gn
diff --git a/chrome_elf/BUILD.gn b/chrome_elf/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..8229c211502d802c49d46386c9d9130e1a2b6c4f
--- /dev/null
+++ b/chrome_elf/BUILD.gn
@@ -0,0 +1,212 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//chrome/version.gni")
+import("//testing/test.gni")
+
+process_version("chrome_elf_resources") {
+ source = "//chrome/app/chrome_version.rc.version"
+ output = "$target_gen_dir/chrome_elf_version.rc"
+ extra_args = [
+ "-f",
+ rebase_path("chrome_elf.ver"),
+ ]
+}
+
+shared_library("chrome_elf") {
+ sources = [
+ "chrome_elf_main.cc",
+ "chrome_elf_main.h",
+ "$target_gen_dir/chrome_elf_version.rc",
+ ]
+ deps = [
+ ":blacklist",
+ ":chrome_elf_breakpad",
+ ":chrome_elf_lib",
+ ":chrome_elf_resources",
+ ]
+ configs += [ "//build/config/win:windowed" ]
brettw 2015/01/22 20:12:10 I think you'll also need to do configs -= [ "//b
Slava Chigrin 2015/01/22 22:06:00 Done.
+ ldflags = [
+ "/NODEFAULTLIB:user32.lib",
+ "/DEF:" + rebase_path("chrome_elf.def"),
+ ]
+ if (cpu_arch == "x86") {
+ # Don"t set an x64 base address (to avoid breaking HE-ASLR).
+ ldflags += [ "/BASE:0x01c20000" ]
+ }
+}
+
+source_set("chrome_elf_lib") {
brettw 2015/01/22 20:12:10 I would normally not duplicate the directory name
Slava Chigrin 2015/01/22 22:06:00 Done.
+ sources = [
+ "create_file/chrome_create_file.cc",
+ "create_file/chrome_create_file.h",
+ "ntdll_cache.cc",
+ "ntdll_cache.h",
+ ]
+ deps = [
+ ":chrome_elf_common",
+ "//base:base_static",
+ "//sandbox",
+ ]
+}
+
+source_set("chrome_elf_constants") {
+ sources = [
+ "chrome_elf_constants.cc",
+ "chrome_elf_constants.h",
+ ]
+}
+
+source_set("chrome_elf_common") {
+ deps = [
+ ":chrome_elf_constants",
+ ]
+ sources = [
+ "chrome_elf_types.h",
+ "chrome_elf_util.cc",
+ "chrome_elf_util.h",
+ "thunk_getter.cc",
+ "thunk_getter.h",
+ ]
+}
+
+source_set("chrome_elf_breakpad") {
+ include_dirs = [ "$target_gen_dir" ]
+ sources = [
+ "breakpad.cc",
+ "breakpad.h",
+ ]
+ deps = [
+ ":chrome_elf_common",
+ "//breakpad:breakpad_handler",
+ "//chrome:version_header",
+ ]
+}
+
+if (is_component_build) {
+ shared_library("chrome_redirects") {
+ sources = [
+ "chrome_redirects_main.cc",
+ ]
+ deps = [
+ ":chrome_elf_lib",
+ ]
+ configs += [ "//build/config/win:windowed" ]
+ ldflags = [ "/DEF:" + rebase_path("chrome_redirects.def") ]
+
+ if (cpu_arch == "x86") {
+ # Don't set an x64 base address (to avoid breaking HE-ASLR).
+ ldflags += [ "/BASE:0x01c20000" ]
+ }
+ }
+}
+
+source_set("dll_hash") {
+ deps = [
+ "//base",
+ ]
+ sources = [
+ "dll_hash/dll_hash.cc",
+ "dll_hash/dll_hash.h",
+ ]
+}
+
+executable("dll_hash_main") {
+ deps = [
+ ":dll_hash",
+ ]
+ sources = [
+ "dll_hash/dll_hash_main.cc",
+ ]
+}
+
+static_library("blacklist") {
+ sources = [
+ "blacklist/blacklist.cc",
+ "blacklist/blacklist.h",
+ "blacklist/blacklist_interceptions.cc",
+ "blacklist/blacklist_interceptions.h",
+ ]
+ deps = [
+ # Depend on base_static, but do NOT take a dependency on base.gyp:base
+ # as that would risk pulling in base's link-time dependencies which
+ # chrome_elf cannot do.
+ "//base:base_static",
+ ":chrome_elf_breakpad",
+ ":chrome_elf_constants",
+ "//sandbox:sandbox",
+ ]
+}
+
+test("chrome_elf_unittests_exe") {
+ output_name = "chrome_elf_unittests"
+ sources = [
+ "blacklist/test/blacklist_test.cc",
+ "chrome_elf_util_unittest.cc",
+ "create_file/chrome_create_file_unittest.cc",
+ "elf_imports_unittest.cc",
+ "ntdll_cache_unittest.cc",
+ ]
+ include_dirs = [ "$target_gen_dir" ]
+ deps = [
+ ":chrome_elf_lib",
+ "//base",
+ "//base/test:run_all_unittests",
+ "//base/test:test_support",
+ "//sandbox",
+ "//testing/gtest",
+ ":blacklist",
+ ":blacklist_test_main_dll",
+ ]
+ data_deps = [
+ ":blacklist_test_dll_1",
+ ":blacklist_test_dll_2",
+ ":blacklist_test_dll_3",
+ ]
+}
+
+group("chrome_elf_unittests") {
brettw 2015/01/22 20:12:10 GN can do this better which will let us clean up t
Slava Chigrin 2015/01/22 22:06:00 Done.
+ testonly = true
+
+ # A dummy target to ensure that chrome_elf.dll and chrome.exe gets built
+ # when building chrome_elf_unittests.exe without introducing an
+ # explicit runtime dependency.
+ deps = [
+ "//chrome",
+ ":chrome_elf",
+ ":chrome_elf_unittests_exe",
+ ]
+}
+
+shared_library("blacklist_test_main_dll") {
+ sources = [
+ "blacklist/test/blacklist_test_main_dll.cc",
+ ]
+ deps = [
+ "//base",
+ ":blacklist",
+ ]
+ ldflags =
+ [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_main_dll.def") ]
brettw 2015/01/22 20:12:10 I usually add the second parameter to rebase path:
Slava Chigrin 2015/01/22 22:06:00 Done.
+}
+
+shared_library("blacklist_test_dll_1") {
+ sources = [
+ "blacklist/test/blacklist_test_dll_1.cc",
+ ]
+ ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_1.def") ]
+}
+
+shared_library("blacklist_test_dll_2") {
+ sources = [
+ "blacklist/test/blacklist_test_dll_2.cc",
+ ]
+ ldflags = [ "/DEF:" + rebase_path("blacklist/test/blacklist_test_dll_2.def") ]
+}
+
+shared_library("blacklist_test_dll_3") {
+ sources = [
+ "blacklist/test/blacklist_test_dll_3.cc",
+ ]
+}
« build/config/compiler/BUILD.gn ('K') | « chrome/renderer/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698