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

Side by Side Diff: services/nacl/BUILD.gn

Issue 1382713002: Creating a pexe content handler to translate and run pexes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Added Mojom interface to communicate with translation nexes Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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("//mojo/public/mojo_application.gni") 5 import("//mojo/public/mojo_application.gni")
6 import("//mojo/public/tools/bindings/mojom.gni")
6 7
7 # Trusted code 8 # Trusted code
8 if (!is_nacl) { 9 if (!is_nacl) {
9 mojo_native_application("nacl_content_handler") { 10 mojo_native_application("nacl_content_handler") {
10 sources = [ 11 sources = [
11 "content_handler_main.cc", 12 "content_handler_main.cc",
12 ] 13 ]
13 14
14 deps = [ 15 deps = [
15 "//base", 16 "//base",
16 "//mojo/application:application", 17 "//mojo/application:application",
17 "//mojo/application:content_handler", 18 "//mojo/application:content_handler",
18 "//mojo/data_pipe_utils", 19 "//mojo/data_pipe_utils",
19 "//mojo/message_pump", 20 "//mojo/message_pump",
20 "//mojo/public/platform/native:system_impl_private", 21 "//mojo/public/platform/native:system_impl_private",
21 "//mojo/services/network/interfaces", 22 "//mojo/services/network/interfaces",
22 "//mojo/nacl/sfi/nacl_bindings:monacl_sel", 23 "//mojo/nacl/sfi/nacl_bindings:monacl_sel",
23 "//url", 24 "//url",
24 ] 25 ]
25 26
26 data_deps = [ 27 data_deps = [
27 "//mojo/nacl/sfi/nacl_bindings:irt_mojo(//build/toolchain/nacl:irt_${targe t_cpu})", 28 "//mojo/nacl/sfi/nacl_bindings:irt_mojo(//build/toolchain/nacl:irt_${targe t_cpu})",
28 ] 29 ]
29 } 30 }
30 31
31 if (current_cpu == "x86" || current_cpu == "arm") { 32 if (current_cpu == "x86" || current_cpu == "arm") {
32 # Non-SFI NaCl can only be executed by a 32-bit process, so our 33 # Non-SFI NaCl can only be executed by a 32-bit process, so our
33 # content handler must be built and launched as a 32-bit process as well. 34 # content handler must be built and launched as a 32-bit process as well.
34 mojo_native_application("nacl_content_handler_nonsfi_32_bit") { 35 mojo_native_application("nacl_content_handler_nonsfi_32_bit") {
36 output_name = "nacl_content_handler_nonsfi_nexe"
35 sources = [ 37 sources = [
36 "content_handler_main_nonsfi.cc", 38 "content_handler_main_nonsfi.cc",
37 ] 39 ]
38 40
39 deps = [ 41 deps = [
40 "//base", 42 "//base",
41 "//mojo/application:application", 43 "//mojo/application:application",
42 "//mojo/application:content_handler", 44 "//mojo/application:content_handler",
43 "//mojo/data_pipe_utils", 45 "//mojo/data_pipe_utils",
44 "//mojo/public/platform/native:mgl_thunks", 46 "//mojo/public/platform/native:mgl_thunks",
45 "//mojo/public/platform/native:mgl_onscreen_thunks", 47 "//mojo/public/platform/native:mgl_onscreen_thunks",
46 "//mojo/message_pump", 48 "//mojo/message_pump",
47 "//mojo/nacl/nonsfi:irt_mojo_nonsfi", 49 "//mojo/nacl/nonsfi:irt_mojo_nonsfi",
48 "//mojo/public/cpp/application:application", 50 "//mojo/public/cpp/application:application",
49 "//native_client/src/nonsfi/loader:elf_loader", 51 "//native_client/src/nonsfi/loader:elf_loader",
50 ] 52 ]
51 } 53 }
54 mojo_native_application("nacl_content_handler_nonsfi_pexe_32_bit") {
Petr Hosek 2015/10/27 15:07:52 Nit: GN convention is to avoid duplicating the dir
Sean Klein 2015/10/28 17:02:41 Done.
55 output_name = "nacl_content_handler_nonsfi_pexe"
56 sources = [
57 "content_handler_main_nonsfi_pexe.cc",
58 ]
59
60 deps = [
61 ":pnacl_translator_bindings",
62 "//base",
63 "//mojo/application:application",
64 "//mojo/application:content_handler",
65 "//mojo/data_pipe_utils",
66 "//mojo/public/platform/native:mgl_thunks",
Mark Seaborn 2015/10/27 17:30:20 These are being repeated across all of these mojo_
Sean Klein 2015/10/28 17:02:41 Done.
67 "//mojo/public/platform/native:mgl_onscreen_thunks",
68 "//mojo/message_pump",
69 "//mojo/nacl/nonsfi:irt_mojo_nonsfi",
70 "//native_client/src/nonsfi/loader:elf_loader",
71 ]
72 }
73 mojo_native_application("pnacl_compile_32_bit") {
74 output_name = "pnacl_compile"
75 sources = [
76 "pnacl_compile.cc",
77 ]
78
79 deps = [
80 ":pnacl_translator_bindings",
81 "//base",
82 "//mojo/nacl/nonsfi:irt_mojo_nonsfi",
83 "//mojo/public/platform/native:mgl_thunks",
84 "//mojo/public/platform/native:mgl_onscreen_thunks",
85 "//mojo/public/cpp/application:standalone",
86 "//native_client/src/nonsfi/loader:elf_loader",
87 ]
88 }
89 mojo_native_application("pnacl_link_32_bit") {
90 output_name = "pnacl_link"
91 sources = [
92 "pnacl_link.cc",
93 ]
94
95 deps = [
96 ":pnacl_translator_bindings",
97 "//base",
98 "//mojo/nacl/nonsfi:irt_mojo_nonsfi",
99 "//mojo/public/platform/native:mgl_thunks",
100 "//mojo/public/platform/native:mgl_onscreen_thunks",
101 "//mojo/public/cpp/application:standalone",
102 "//native_client/src/nonsfi/loader:elf_loader",
103 ]
104 }
52 105
53 # Copy to the root build directory so that the '#!' prefix line for invoking 106 # Copy to the root build directory so that the '#!' prefix line for invoking
54 # our content handler can simply be "mojo:nacl_content_handler_nonsfi". 107 # our content handler can simply be "mojo:nacl_content_handler_nonsfi".
55 copy("nacl_content_handler_nonsfi_copy") { 108 # Either way, build the same dependencies.
56 sources = [ 109 shared_deps = [
57 "${root_out_dir}/nacl_content_handler_nonsfi_32_bit.mojo", 110 ":nacl_content_handler_nonsfi_32_bit",
58 ] 111 ":nacl_content_handler_nonsfi_pexe_32_bit",
59 outputs = [ 112 ":pnacl_compile_32_bit",
60 "${root_build_dir}/nacl_content_handler_nonsfi.mojo", 113 ":pnacl_link_32_bit",
61 ] 114 ]
62 deps = [ 115 if (root_out_dir != root_build_dir) {
63 ":nacl_content_handler_nonsfi_32_bit", 116 copy("nacl_content_handler_nonsfi_copy") {
64 ] 117 sources = [
118 "${root_out_dir}/nacl_content_handler_nonsfi_nexe.mojo",
119 "${root_out_dir}/nacl_content_handler_nonsfi_pexe.mojo",
120 "${root_out_dir}/pnacl_compile.mojo",
121 "${root_out_dir}/pnacl_link.mojo",
122 ]
123 outputs = [
124 "${root_build_dir}/{{source_name_part}}.mojo",
Petr Hosek 2015/10/27 15:07:52 You can use {{source_file_part}} here and omit the
Sean Klein 2015/10/28 17:02:41 Done.
125 ]
126 deps = shared_deps
127 }
128 } else {
129 group("nacl_content_handler_nonsfi_copy") {
130 deps = shared_deps
131 }
65 } 132 }
66 } 133 }
67 } 134 }
68 135
69 # This group serves as a 64 to 32 bit transformation for Linux. If we are 136 # This group serves as a 64 to 32 bit transformation for Linux. If we are
70 # using a 64 bit toolchain, build the nonsfi nacl content handler as 32 bit. 137 # using a 64 bit toolchain, build the nonsfi nacl content handler as 32 bit.
71 group("nacl_content_handler_nonsfi") { 138 group("nacl_content_handler_nonsfi") {
72 deps = [] 139 deps = []
73 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { 140 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) {
74 # The toolchain is hardcoded as 32-bit clang here -- although it must 141 # The toolchain is hardcoded as 32-bit clang here -- although it must
75 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would 142 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would
76 # be defined as the 32 bit variant of whatever is being used (be it clang, 143 # be defined as the 32 bit variant of whatever is being used (be it clang,
77 # gcc, or something else). 144 # gcc, or something else).
78 deps += [ ":nacl_content_handler_nonsfi_copy(//build/toolchain/linux:clang_x 86)" ] 145 deps += [ ":nacl_content_handler_nonsfi_copy(//build/toolchain/linux:clang_x 86)" ]
79 } else { 146 } else {
80 deps += [ ":nacl_content_handler_nonsfi_copy" ] 147 deps += [ ":nacl_content_handler_nonsfi_copy" ]
81 } 148 }
82 } 149 }
150
151 mojom("pnacl_translator_bindings") {
152 sources = [
153 "pnacl_compile.mojom",
154 "pnacl_link.mojom",
155 ]
156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698