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

Side by Side Diff: build/config/nacl/rules.gni

Issue 1432313002: Factor out nmf generation into a GN template (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | ppapi/BUILD.gn » ('j') | ppapi/BUILD.gn » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2015 The Native Client Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/features.gni")
6 import("//build/config/nacl/config.gni")
7
8 template("generate_nmf") {
brettw 2015/11/11 21:20:12 All templates should have comments at the top list
Petr Hosek 2015/11/11 23:35:03 Done.
9 assert(defined(invoker.executable), "Must define executable")
10 assert(defined(invoker.nmf), "Must define nmf")
11 objdump = rebase_path("${nacl_toolprefix}objdump")
brettw 2015/11/11 21:20:12 You only use this once, so I'd just inline the reb
Petr Hosek 2015/11/11 23:35:03 Done.
12
13 action(target_name) {
14 forward_variables_from(invoker,
15 [
16 "deps",
17 "data_deps",
18 "executable",
19 "nmf",
20 "nmfflags",
21 "public_deps",
22 "testonly",
23 ])
24
25 script = "//native_client_sdk/src/tools/create_nmf.py"
26 sources = [
27 executable,
28 ]
29 outputs = [
30 nmf,
31 ]
32 args = [
33 "--no-default-libpath",
34 "--objdump=" + objdump,
35 "--output=" + rebase_path(nmf, root_build_dir),
36 ]
37 if (is_nacl_glibc) {
38 args += [ "--library-path=" + rebase_path(root_out_dir) ]
Roland McGrath 2015/11/11 21:44:31 Maybe the library path dir should be listed in inp
brettw 2015/11/11 22:32:56 You can't list directories as inputs, only files.
Petr Hosek 2015/11/11 23:35:03 I could remove this and it'll be up to the invoker
39 if (current_cpu == "x86") {
40 args += [ "--library-path=" +
41 rebase_path("${nacl_toolchain_tooldir}/lib32") ]
42 data = [
43 "$root_build_dir/lib32/",
brettw 2015/11/11 21:20:12 It seems surprising to me that depending on a sing
Petr Hosek 2015/11/11 23:35:03 That's intentional because those are two different
brettw 2015/11/12 17:40:58 Okay, I guess the analogy would be that normal pro
44 ]
45 } else if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) {
brettw 2015/11/11 21:20:12 I'm confused by these conditions. The first if tes
Roland McGrath 2015/11/11 21:44:32 Why is Windows special? If this is the proper con
Petr Hosek 2015/11/11 23:35:03 This is taken from GYP and I haven't found any com
46 args +=
47 [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ]
48 data = [
49 "$root_build_dir/lib64/",
50 ]
51 } else if (current_cpu == "arm") {
Roland McGrath 2015/11/11 21:44:31 Just make this the default 'else' unless you are g
Petr Hosek 2015/11/11 23:35:03 Done.
52 args +=
53 [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ]
54 data = [
55 "$root_build_dir/lib/",
56 ]
57 }
58 }
59 args += nmfflags + rebase_path(sources, root_build_dir)
60 if (is_nacl_glibc && current_cpu == "arm") {
61 deps += [ "//native_client/src/untrusted/elf_loader:elf_loader" ]
62 }
63 }
64 }
65
66 template("generate_nonsfi_test_nmf") {
67 assert(defined(invoker.executable), "Must define executable")
68 assert(defined(invoker.nmf), "Must define nmf")
69
70 action(target_name) {
71 forward_variables_from(invoker,
72 [
73 "deps",
74 "data_deps",
75 "executable",
76 "nmf",
77 "testonly",
78 "public_deps",
79 ])
80
81 script = "//ppapi/tests/create_nonsfi_test_nmf.py"
82 sources = [
83 executable,
84 ]
85 outputs = [
86 nmf,
87 ]
88 if (target_cpu == "x86") {
89 arch = "x86-32"
90 } else if (target_cpu == "x64") {
91 arch = "x86-64"
92 } else if (target_cpu == "arm") {
Roland McGrath 2015/11/11 21:44:32 This can just default to arch = current_cpu. All o
Petr Hosek 2015/11/11 23:35:03 Done.
Petr Hosek 2015/11/13 00:37:38 Actually, in this case we really want target_cpu a
93 arch = "arm"
94 }
95 args = [
96 "--program=" + rebase_path(executable, root_build_dir),
97 "--arch=${arch}",
98 "--output=" + rebase_path(nmf, root_build_dir),
99 ]
100 }
101 }
OLDNEW
« no previous file with comments | « no previous file | ppapi/BUILD.gn » ('j') | ppapi/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698