forked from crosswalk-project/realsense-extensions-crosswalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
86 lines (80 loc) · 2.39 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright (c) 2015 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
action_foreach("pickup_dll") {
script = "//extensions/scripts/pickup_dll.py"
sources = [
"$root_build_dir/enhanced_photography.dll",
"$root_build_dir/scene_perception.dll",
"$root_build_dir/face.dll",
]
inputs = [
"//extensions/scripts/XWalkExtensionHooks_template.js",
]
dist_dir = "$root_build_dir/realsense_extensions"
outputs = [
"$dist_dir/{{source_name_part}}/{{source_file_part}}",
"$dist_dir/{{source_name_part}}/XWalkExtensionHooks.js",
"$dist_dir/{{source_name_part}}",
]
args = ["{{source}}", "{{output}}"]
}
action("package_sample_app") {
dist_dir = "$root_build_dir/realsense_extensions"
script = "//extensions/scripts/package_sample.py"
sources = [
"//extensions/sample",
"$dist_dir/enhanced_photography",
"$dist_dir/scene_perception",
"$dist_dir/face",
]
hasRuntime = getenv("NO_RS_RUNTIME_HOOKS")
v = read_file("VERSION", "scope")
version = v.MAJOR + "." + v.RSSDK + "." + v.MINOR
app_version = "$version" + ".0"
package = "org.xwalk.rs_sample"
bundle_file = "$root_build_dir/$package" + "_with_rssdk_runtime" + "-$app_version.exe"
outputs = [
"$root_build_dir/$package-$app_version.msi",
"$bundle_file"
]
if (hasRuntime == "1" || hasRuntime == "true") {
outputs -= ["$bundle_file"]
}
# Set the "windows" as default platform.
platform = "windows"
if (is_win) {
platform = "windows"
} else if (is_android) {
platform = "android"
}
args = ["-e", rebase_path("$dist_dir"),
"-w", rebase_path("//extensions/sample"),
"-o", rebase_path("$root_build_dir/sample_app"),
"-p", "$platform",
"-v", "$version",
]
}
group("all_extensions") {
deps = [
"//extensions/benchmarks/bench_image/win:bench_image",
"//extensions/realsense/common:common_idl",
"//extensions/realsense/common:common_utils",
"//extensions/realsense/enhanced_photography/win:enhanced_photography",
"//extensions/realsense/face/win:face",
"//extensions/realsense/scene_perception/win:scene_perception",
"//extensions/realsense/session/win:session",
]
}
group("dist") {
deps = [
":all_extensions",
":pickup_dll",
]
}
group("sample_app") {
deps = [
":dist",
":package_sample_app",
]
}