about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-26 20:11:52 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-26 20:11:52 +0200
commitce87773b7ec3fbf86223eb3e046670391a7ad89d (patch)
tree4e68cc81cd243e28bb765fbdaa885e1064ca0a87 /src
parente0950d5f6eed46509246b4820ac478a5920354da (diff)
downloadchawan-ce87773b7ec3fbf86223eb3e046670391a7ad89d.tar.gz
Allow overriding libcurl name
for better compatibility with curl-impersonate
Diffstat (limited to 'src')
-rw-r--r--src/bindings/curl.nim12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bindings/curl.nim b/src/bindings/curl.nim
index ed2057eb..bab180f5 100644
--- a/src/bindings/curl.nim
+++ b/src/bindings/curl.nim
@@ -1,7 +1,13 @@
 const curllib = (func(): string =
-  when defined(windows): return "libcurl.dll"
-  elif defined(macos): return "libcurl(|.4|.4.8.0).dylib"
-  else: return "libcurl.so(|.4|.4.8.0)" # assume posix
+  const curlLibName {.strdefine.} = ""
+  when curlLibName != "":
+    return curlLibName
+  elif defined(windows):
+    return "libcurl.dll"
+  elif defined(macos):
+    return "libcurl(|.4|.4.8.0).dylib"
+  else: # assume posix
+    return "libcurl.so(|.4|.4.8.0)"
 )()
 
 const