forked from realm/realm-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
realm.gypi
143 lines (143 loc) · 4.07 KB
/
realm.gypi
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{
"variables": {
"use_realm_debug%": "<!(node -p \"'REALMJS_USE_DEBUG_CORE' in process.env ? 1 : 0\")"
},
"conditions": [
["OS=='mac'", {
"variables": {
"realm_enable_sync%": "1"
}
}, {
"variables": {
"realm_enable_sync%": "0"
}
}],
["OS=='win'", {
"conditions": [
["target_arch == 'ia32'", {
"variables": {
"realm_library_suffix": "-x86"
}
}, {
"variables": {
"realm_library_suffix": "-<(target_arch)"
}
}]
]
}, {
"variables": {
"realm_library_suffix": "-node"
}
}]
],
"targets": [
{
"target_name": "realm-core",
"type": "none",
"direct_dependent_settings": {
"conditions": [
["use_realm_debug", {
"defines": [ "REALM_DEBUG=1" ],
"libraries": [ "-lrealm<(realm_library_suffix)-dbg" ]
}, {
"libraries": [ "-lrealm<(realm_library_suffix)" ]
}]
]
},
"all_dependent_settings": {
"defines": [ "REALM_PLATFORM_NODE=1", "REALM_ENABLE_SYNC=<(realm_enable_sync)" ]
},
"variables": {
"prefix": "<!(node -p \"process.env.REALM_CORE_PREFIX || String()\")"
},
"conditions": [
["prefix!=''", {
"all_dependent_settings": {
"include_dirs": [ "<(prefix)/src" ],
},
"direct_dependent_settings": {
"library_dirs": [ "<(prefix)/src/realm" ]
}
}, {
"dependencies": [ "vendored-realm" ]
}],
["OS=='win'", {
"all_dependent_settings": {
"defines": [ "PTW32_STATIC_LIB" ]
}
}, {
"all_dependent_settings": {
"defines": [ "REALM_HAVE_CONFIG" ]
}
}]
]
},
{
"target_name": "realm-sync",
"type": "none",
"dependencies": [ "realm-core" ], # sync headers include core headers
"direct_dependent_settings": {
"conditions": [
["use_realm_debug", {
"libraries": [ "-lrealm-sync<(realm_library_suffix)-dbg" ]
}, {
"libraries": [ "-lrealm-sync<(realm_library_suffix)" ]
}]
]
},
"export_dependent_settings": [ "realm-core" ], # depending on sync is tantamount to depending on core
"variables": {
"prefix": "<!(node -p \"process.env.REALM_SYNC_PREFIX || String()\")"
},
"conditions": [
["prefix!=''", {
"all_dependent_settings": {
"include_dirs": [ "<(prefix)/src" ],
},
"direct_dependent_settings": {
"library_dirs": [ "<(prefix)/src/realm" ]
}
}, {
"dependencies": [ "vendored-realm" ]
}]
],
},
{
"variables": {
"vendor_dir%": "<(module_root_dir)/vendor"
},
"target_name": "vendored-realm",
"type": "none",
"all_dependent_settings": {
"include_dirs": [ "<(module_root_dir)/vendor/realm-node/include" ],
"library_dirs": [
"<(module_root_dir)/vendor/realm-node/",
"<(module_root_dir)/vendor/realm-node/lib",
"<(module_root_dir)/vendor/realm-node/osx"
]
},
"conditions": [
["realm_download_binaries and OS=='win'", {
"actions": [
{
"action_name": "download-realm",
"inputs": [ "<(module_root_dir)/scripts/download-realm.js" ],
"outputs": [ "<(module_root_dir)/vendor/realm-node" ],
"action": [ "node", "<(module_root_dir)/scripts/download-realm.js", "node", "<(use_realm_debug)" ]
}
]
}],
["realm_download_binaries and OS!='win'", {
"actions": [
{
"action_name": "download-realm",
"inputs": [ ],
"outputs": [ "<(module_root_dir)/vendor/realm-node" ],
"action": [ "<(module_root_dir)/scripts/download-core.sh", "node", "<(realm_enable_sync)" ]
}
]
}]
]
}
]
}