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

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

Issue 877553008: Land prep work to enable NaCl in the Linux x64 GN builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to #317924 Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 # All toolchains use the same generated code. 1 # All toolchains use the same generated code.
2 gen_dir = "$root_build_dir/gen/mojo/nacl" 2 gen_dir = "$root_build_dir/gen/mojo/nacl"
3 3
4 # Only allow the generator to be run by one toolchain. 4 # Only allow the generator to be run by one toolchain.
5 if (current_toolchain == default_toolchain) { 5 if (current_toolchain == default_toolchain) {
6 # Generate the code to plumb the Mojo public API into the NaCl sandbox. 6 # Generate the code to plumb the Mojo public API into the NaCl sandbox.
7 action("mojo_nacl_codegen") { 7 action("mojo_nacl_codegen") {
8 script = "generator/generate_nacl_bindings.py" 8 script = "generator/generate_nacl_bindings.py"
9 args = [ 9 args = [
10 "-d", 10 "-d",
11 rebase_path(gen_dir, root_build_dir), 11 rebase_path(gen_dir, root_build_dir),
12 ] 12 ]
13 inputs = [ 13 inputs = [
14 script, 14 script,
15 "generator/interface.py", 15 "generator/interface.py",
16 "generator/interface_dsl.py", 16 "generator/interface_dsl.py",
17 "generator/mojo_syscall.cc.tmpl", 17 "generator/mojo_syscall.cc.tmpl",
18 "generator/libmojo.cc.tmpl", 18 "generator/libmojo.cc.tmpl",
19 ] 19 ]
20 outputs = [ 20 outputs = [
21 "$gen_dir/mojo_irt.c", 21 "$gen_dir/mojo_irt.c",
22 "$gen_dir/mojo_irt.h", 22 "$gen_dir/mojo_irt.h",
23 "$gen_dir/mojo_syscall.cc", 23 "$gen_dir/mojo_syscall.cc",
24 "$gen_dir/libmojo.cc", 24 "$gen_dir/libmojo.cc",
25 ] 25 ]
26 public_configs =
27 [ "//third_party/mojo/src/mojo/public/build/config:mojo_sdk" ]
Dirk Pranke 2015/02/25 21:08:46 I'm not sure if this is the right way to handle th
brettw 2015/02/25 21:27:29 Doesn't look obviously wrong to me.
Dirk Pranke 2015/02/25 21:37:40 Acknowledged.
26 } 28 }
27 } 29 }
28 30
29 # Trusted code 31 # Trusted code
30 if (!is_nacl) { 32 if (!is_nacl) {
31 # A library for launching a NaCl sandbox connected to a Mojo embedder. 33 # A library for launching a NaCl sandbox connected to a Mojo embedder.
32 static_library("monacl_sel") { 34 static_library("monacl_sel") {
33 sources = [ 35 sources = [
34 "mojo_syscall_internal.h", 36 "mojo_syscall_internal.h",
35 "$gen_dir/mojo_syscall.cc", 37 "$gen_dir/mojo_syscall.cc",
36 "monacl_sel_main.cc", 38 "monacl_sel_main.cc",
37 ] 39 ]
40
38 deps = [ 41 deps = [
39 # This target makes sure we have all the pre-processor defines needed to 42 # This target makes sure we have all the pre-processor defines needed to
40 # use NaCl's headers. 43 # use NaCl's headers.
41 "//native_client/build/config/nacl:nacl_base", 44 "//native_client/build/config/nacl:nacl_base",
42 "//native_client/src/trusted/desc:nrd_xfer", 45 "//native_client/src/trusted/desc:nrd_xfer",
43 "//native_client/src/trusted/service_runtime:sel_main_chrome", 46 "//native_client/src/trusted/service_runtime:sel_main_chrome",
44 ":mojo_nacl_codegen($default_toolchain)", 47 ":mojo_nacl_codegen($default_toolchain)",
45 ] 48 ]
46 } 49 }
47 50
(...skipping 14 matching lines...) Expand all
62 65
63 # Untrusted code 66 # Untrusted code
64 if (is_nacl) { 67 if (is_nacl) {
65 # Thunk mapping the Mojo public API onto NaCl syscalls. 68 # Thunk mapping the Mojo public API onto NaCl syscalls.
66 static_library("mojo") { 69 static_library("mojo") {
67 sources = [ 70 sources = [
68 "$gen_dir/libmojo.cc", 71 "$gen_dir/libmojo.cc",
69 "$gen_dir/mojo_irt.h", 72 "$gen_dir/mojo_irt.h",
70 ] 73 ]
71 include_dirs = [ "$root_build_dir/gen" ] 74 include_dirs = [ "$root_build_dir/gen" ]
72 deps = [ 75 public_deps = [
73 ":mojo_nacl_codegen($default_toolchain)", 76 ":mojo_nacl_codegen($default_toolchain)",
74 ] 77 ]
75 } 78 }
76 79
77 # Unit test for the Mojo public API. 80 # Unit test for the Mojo public API.
78 executable("monacl_test") { 81 executable("monacl_test") {
79 testonly = true 82 testonly = true
80 sources = [ 83 sources = [
81 "//third_party/mojo/src/mojo/public/cpp/system/tests/core_unittest.cc", 84 "//third_party/mojo/src/mojo/public/cpp/system/tests/core_unittest.cc",
82 "//third_party/mojo/src/mojo/public/cpp/system/tests/macros_unittest.cc", 85 "//third_party/mojo/src/mojo/public/cpp/system/tests/macros_unittest.cc",
83 ] 86 ]
87 include_dirs = [ "//third_party/mojo/src" ]
brettw 2015/02/25 21:27:29 We shouldn't have to specify this kind of thing ma
Dirk Pranke 2015/02/25 21:37:40 Agreed, which is partially why I had the comment a
84 deps = [ 88 deps = [
85 "//testing/gtest:gtest", 89 "//testing/gtest:gtest",
86 "//testing/gtest:gtest_main", 90 "//testing/gtest:gtest_main",
87 "//third_party/mojo/src/mojo/public/c/system/tests:tests", 91 "//third_party/mojo/src/mojo/public/c/system/tests:tests",
88 "//third_party/mojo/src/mojo/public/cpp/system:system", 92 "//third_party/mojo/src/mojo/public/cpp/system:system",
89 ":mojo", 93 ":mojo",
90 ] 94 ]
91 } 95 }
92 96
97 source_set("irt_mojo_sources") {
98 cflags_c = [ "-std=c99" ]
99 sources = [
100 "$gen_dir/mojo_irt.c",
101 "$gen_dir/mojo_irt.h",
102 ]
103 include_dirs = [ "$root_build_dir/gen" ]
brettw 2015/02/25 21:27:29 You can delete this line, it should be there by de
Dirk Pranke 2015/02/25 21:37:41 It didn't seem to be, but I'll double check. Maybe
104 public_deps = [
105 "//native_client/build/config/nacl:nacl_base",
106 "//native_client/src/untrusted/irt:irt_core_lib",
107 "//native_client/src/untrusted/nacl:imc_syscalls",
108 ":mojo_nacl_codegen($default_toolchain)",
109 ]
110 }
111
93 executable("irt_mojo") { 112 executable("irt_mojo") {
94 cflags_c = [ "-std=c99" ] 113 cflags_c = [ "-std=c99" ]
95 sources = [ 114 sources = [
96 "irt_entry_mojo.c", 115 "irt_entry_mojo.c",
97 "$gen_dir/mojo_irt.c",
98 "$gen_dir/mojo_irt.h",
99 ] 116 ]
100 include_dirs = [ "$root_build_dir/gen" ] 117 include_dirs = [ "$root_build_dir/gen" ]
101 deps = [ 118 deps = [
102 "//native_client/build/config/nacl:nacl_base", 119 ":irt_mojo_sources",
103 "//native_client/src/untrusted/irt:irt_core_lib",
104 "//native_client/src/untrusted/nacl:imc_syscalls",
105 ":mojo_nacl_codegen($default_toolchain)",
106 ] 120 ]
107 } 121 }
108 } 122 }
109 123
110 group("mojo_nacl") { 124 group("mojo_nacl") {
111 deps = [ 125 deps = [
112 ":irt_mojo(//native_client/build/toolchain/nacl:irt_${current_cpu})", 126 ":irt_mojo(//native_client/build/toolchain/nacl:irt_${current_cpu})",
113 ] 127 ]
114 } 128 }
115 129
116 group("mojo_nacl_tests") { 130 group("mojo_nacl_tests") {
117 testonly = true 131 testonly = true
118 deps = [ 132 deps = [
119 ":monacl_shell", 133 ":monacl_shell",
120 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${current_cp u})", 134 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${current_cp u})",
121 ] 135 ]
122 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698