@@ -141,10 +141,31 @@ cc_library(
141
141
"src/wasmtime/wasmtime.cc" ,
142
142
],
143
143
hdrs = ["include/proxy-wasm/wasmtime.h" ],
144
+ copts = [
145
+ "-DWASM_API_EXTERN=" ,
146
+ ],
144
147
defines = [
145
148
"PROXY_WASM_HAS_RUNTIME_WASMTIME" ,
146
149
"PROXY_WASM_HOST_ENGINE_WASMTIME" ,
147
150
],
151
+ # See: https://bytecodealliance.github.io/wasmtime/c-api/
152
+ linkopts = select ({
153
+ "@platforms//os:macos" : [],
154
+ "@platforms//os:windows" : [
155
+ "ws2_32.lib" ,
156
+ "advapi32.lib" ,
157
+ "userenv.lib" ,
158
+ "ntdll.lib" ,
159
+ "shell32.lib" ,
160
+ "ole32.lib" ,
161
+ "bcrypt.lib" ,
162
+ ],
163
+ "//conditions:default" : [
164
+ "-ldl" ,
165
+ "-lm" ,
166
+ "-lpthread" ,
167
+ ],
168
+ }),
148
169
deps = [
149
170
":wasm_vm_headers" ,
150
171
"//external:wasmtime" ,
@@ -179,10 +200,31 @@ cc_library(
179
200
"src/wasmtime/prefixed_wasmtime.cc" ,
180
201
],
181
202
hdrs = ["include/proxy-wasm/wasmtime.h" ],
203
+ copts = [
204
+ "-DWASM_API_EXTERN=" ,
205
+ ],
182
206
defines = [
183
207
"PROXY_WASM_HAS_RUNTIME_WASMTIME" ,
184
208
"PROXY_WASM_HOST_ENGINE_WASMTIME" ,
185
209
],
210
+ # See: https://bytecodealliance.github.io/wasmtime/c-api/
211
+ linkopts = select ({
212
+ "@platforms//os:macos" : [],
213
+ "@platforms//os:windows" : [
214
+ "ws2_32.lib" ,
215
+ "advapi32.lib" ,
216
+ "userenv.lib" ,
217
+ "ntdll.lib" ,
218
+ "shell32.lib" ,
219
+ "ole32.lib" ,
220
+ "bcrypt.lib" ,
221
+ ],
222
+ "//conditions:default" : [
223
+ "-ldl" ,
224
+ "-lm" ,
225
+ "-lpthread" ,
226
+ ],
227
+ }),
186
228
deps = [
187
229
":wasm_vm_headers" ,
188
230
"//external:prefixed_wasmtime" ,
@@ -204,6 +246,13 @@ cc_library(
204
246
"PROXY_WASM_HAS_RUNTIME_WAVM" ,
205
247
"PROXY_WASM_HOST_ENGINE_WAVM" ,
206
248
],
249
+ linkopts = select ({
250
+ "@platforms//os:macos" : [],
251
+ "@platforms//os:windows" : [],
252
+ "//conditions:default" : [
253
+ "-ldl" ,
254
+ ],
255
+ }),
207
256
deps = [
208
257
":wasm_vm_headers" ,
209
258
"//external:wavm" ,
0 commit comments