-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathcrates.gyp
More file actions
123 lines (123 loc) · 3.01 KB
/
crates.gyp
File metadata and controls
123 lines (123 loc) · 3.01 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
'variables': {
'cargo%': 'cargo',
'cargo_vendor_dir': './vendor',
'cargo_rust_target%': '',
},
'conditions': [
['build_type == "Release"', {
'variables': {
'cargo_build_flags': ['--release'],
},
'conditions': [
['cargo_rust_target!=""', {
'variables': {
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/release/node_crates.lib',
},
}, {
'variables': {
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/release/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
},
}],
],
}, {
'variables': {
'cargo_build_flags': [],
},
'conditions': [
['cargo_rust_target!=""', {
'variables': {
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/debug/node_crates.lib',
},
}, {
'variables': {
'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/debug/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)',
},
}],
],
}]
],
'targets': [
{
'target_name': 'node_crates',
'type': 'none',
'toolsets': ['host', 'target'],
'hard_dependency': 1,
'sources': [
'Cargo.toml',
'Cargo.lock',
'src/lib.rs',
],
'link_settings': {
'libraries': [
'<(node_crates_libpath)',
],
'conditions': [
['OS=="win"', {
'libraries': [
'-lntdll',
'-luserenv'
],
}],
],
},
'conditions': [
['cargo_rust_target!=""', {
'actions': [
{
'action_name': 'cargo_build',
'inputs': [
'<@(_sources)'
],
'outputs': [
'<(node_crates_libpath)'
],
'action': [
'<(python)',
'cargo_build.py',
'$(Platform)',
'<(SHARED_INTERMEDIATE_DIR)',
'<@(cargo_build_flags)',
'--frozen',
],
}
],
}, {
'actions': [
{
'action_name': 'cargo_build',
'inputs': [
'<@(_sources)'
],
'outputs': [
'<(node_crates_libpath)'
],
'action': [
'<(cargo)',
'rustc',
'<@(cargo_build_flags)',
'--frozen',
'--target-dir',
'<(SHARED_INTERMEDIATE_DIR)'
],
}
],
}],
],
},
{
'target_name': 'temporal_capi',
'type': 'none',
'toolsets': ['host', 'target'],
'sources': [],
'dependencies': [
'node_crates',
],
'direct_dependent_settings': {
'include_dirs': [
'<(cargo_vendor_dir)/temporal_capi/bindings/cpp',
],
},
},
]
}