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("//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 = [ "//mojo/nacl/sfi/nacl_bindings:irt_mojo(//build/toolchain/nacl :irt_${target_cpu})" ] | 27 data_deps = [ "//mojo/nacl/sfi/nacl_bindings:irt_mojo(//build/toolchain/nacl :irt_${target_cpu})" ] |
27 } | 28 } |
28 | 29 |
29 if (current_cpu == "x86" || current_cpu == "arm") { | 30 if (current_cpu == "x86" || current_cpu == "arm") { |
30 # Non-SFI NaCl can only be executed by a 32-bit process, so our | 31 # Non-SFI NaCl can only be executed by a 32-bit process, so our |
31 # content handler must be built and launched as a 32-bit process as well. | 32 # content handler must be built and launched as a 32-bit process as well. |
32 mojo_native_application("nacl_content_handler_nonsfi_32_bit") { | 33 mojo_native_application("nacl_content_handler_nonsfi_32_bit") { |
34 output_name = "nacl_content_handler_nonsfi_nexe" | |
33 sources = [ | 35 sources = [ |
34 "content_handler_main_nonsfi.cc", | 36 "content_handler_main_nonsfi.cc", |
35 ] | 37 ] |
36 | 38 |
37 deps = [ | 39 deps = [ |
38 "//base", | 40 "//base", |
39 "//mojo/application:application", | 41 "//mojo/application:application", |
40 "//mojo/application:content_handler", | 42 "//mojo/application:content_handler", |
41 "//mojo/data_pipe_utils", | 43 "//mojo/data_pipe_utils", |
42 "//mojo/message_pump", | 44 "//mojo/message_pump", |
43 "//mojo/nacl/nonsfi:irt_mojo_nonsfi", | 45 "//mojo/nacl/nonsfi:irt_mojo_nonsfi", |
44 "//mojo/public/cpp/application:application", | 46 "//mojo/public/cpp/application:application", |
45 "//native_client/src/nonsfi/loader:elf_loader", | 47 "//native_client/src/nonsfi/loader:elf_loader", |
46 ] | 48 ] |
47 } | 49 } |
50 mojo_native_application("nacl_content_handler_nonsfi_pexe_32_bit") { | |
51 output_name = "nacl_content_handler_nonsfi_pexe" | |
52 sources = [ | |
53 "content_handler_main_nonsfi_pexe.cc", | |
54 ] | |
55 | |
56 deps = [ | |
57 ":pexe_bindings", | |
58 "//base", | |
59 "//mojo/application:application", | |
60 "//mojo/application:content_handler", | |
61 "//mojo/data_pipe_utils", | |
62 "//mojo/message_pump", | |
63 "//mojo/nacl/nonsfi:irt_mojo_nonsfi", | |
64 "//native_client/src/nonsfi/loader:elf_loader", | |
65 ] | |
66 } | |
67 mojo_native_application("pexe_translator_app_32_bit") { | |
68 output_name = "pexe_translator_app" | |
69 sources = [ | |
70 "pexe_translator_app.cc", | |
71 ] | |
72 | |
73 deps = [ | |
74 ":pexe_bindings", | |
75 "//base", | |
76 "//mojo/nacl/nonsfi:irt_mojo_nonsfi", | |
77 "//mojo/public/cpp/application:standalone", | |
78 "//native_client/src/nonsfi/loader:elf_loader", | |
79 ] | |
80 } | |
81 mojo_native_application("pexe_linker_app_32_bit") { | |
82 output_name = "pexe_linker_app" | |
83 sources = [ | |
84 "pexe_linker_app.cc", | |
85 ] | |
86 | |
87 deps = [ | |
88 ":pexe_bindings", | |
89 "//base", | |
90 "//mojo/nacl/nonsfi:irt_mojo_nonsfi", | |
91 "//mojo/public/cpp/application:standalone", | |
92 "//native_client/src/nonsfi/loader:elf_loader", | |
93 ] | |
94 } | |
48 | 95 |
49 # Copy to the root build directory so that the '#!' prefix line for invoking | 96 # Copy to the root build directory so that the '#!' prefix line for invoking |
50 # our content handler can simply be "mojo:nacl_content_handler_nonsfi". | 97 # our content handler can simply be "mojo:nacl_content_handler_nonsfi". |
51 copy("nacl_content_handler_nonsfi_copy") { | 98 copy("nacl_content_handler_nonsfi_copy") { |
52 sources = [ | 99 sources = [ |
53 "${root_out_dir}/nacl_content_handler_nonsfi_32_bit.mojo", | 100 "${root_out_dir}/nacl_content_handler_nonsfi_nexe.mojo", |
101 "${root_out_dir}/nacl_content_handler_nonsfi_pexe.mojo", | |
102 "${root_out_dir}/pexe_linker_app.mojo", | |
103 "${root_out_dir}/pexe_translator_app.mojo", | |
54 ] | 104 ] |
55 outputs = [ | 105 outputs = [ |
56 "${root_build_dir}/nacl_content_handler_nonsfi.mojo", | 106 "${root_build_dir}/{{source_name_part}}.mojo", |
57 ] | 107 ] |
58 deps = [ | 108 deps = [ |
59 ":nacl_content_handler_nonsfi_32_bit", | 109 ":nacl_content_handler_nonsfi_32_bit", |
110 ":nacl_content_handler_nonsfi_pexe_32_bit", | |
111 ":pexe_translator_app_32_bit", | |
112 ":pexe_linker_app_32_bit", | |
60 ] | 113 ] |
61 } | 114 } |
62 } | 115 } |
63 } | 116 } |
64 | 117 |
65 # This group serves as a 64 to 32 bit transformation for Linux. If we are | 118 # This group serves as a 64 to 32 bit transformation for Linux. If we are |
66 # using a 64 bit toolchain, build the nonsfi nacl content handler as 32 bit. | 119 # using a 64 bit toolchain, build the nonsfi nacl content handler as 32 bit. |
67 group("nacl_content_handler_nonsfi") { | 120 group("nacl_content_handler_nonsfi") { |
68 deps = [] | 121 deps = [] |
69 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { | 122 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { |
70 # The toolchain is hardcoded as 32-bit clang here -- although it must | 123 # The toolchain is hardcoded as 32-bit clang here -- although it must |
71 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would | 124 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would |
72 # be defined as the 32 bit variant of whatever is being used (be it clang, | 125 # be defined as the 32 bit variant of whatever is being used (be it clang, |
73 # gcc, or something else). | 126 # gcc, or something else). |
74 deps += [ ":nacl_content_handler_nonsfi_copy(//build/toolchain/linux:clang_x 86)" ] | 127 deps += [ ":nacl_content_handler_nonsfi_copy(//build/toolchain/linux:clang_x 86)" ] |
75 } else { | 128 } else { |
76 deps += [ ":nacl_content_handler_nonsfi_copy" ] | 129 deps += [ ":nacl_content_handler_nonsfi_copy" ] |
77 } | 130 } |
78 } | 131 } |
132 | |
133 mojom("pexe_bindings") { | |
Mark Seaborn
2015/10/20 22:28:58
How about "pexe" -> "pnacl_translator"?
Sean Klein
2015/10/22 21:50:00
Done.
| |
134 sources = [ | |
135 "pexe_linker.mojom", | |
136 "pexe_translator.mojom", | |
137 ] | |
138 } | |
OLD | NEW |