chore: add natpmp

This commit is contained in:
DarshanBPatel 2025-01-02 16:28:23 +05:30
parent b68e16c754
commit d76901e932
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22

View File

@ -5,14 +5,26 @@ if defined(release):
else:
switch("nimcache", "nimcache/debug/$projectName")
proc addVendorPaths(baseDir: string) =
for dir in walkDir(baseDir):
if dir.kind == pcDir:
# Add the current directory
switch("path", dir.path)
switch("path", dir.path / "src")
# If this directory has a vendor subdirectory, process it recursively
let vendorPath = dir.path / "vendor"
if dirExists(vendorPath):
addVendorPaths(vendorPath)
if defined(windows):
switch("passL", "rln.lib")
# Automatically add all vendor subdirectories
for dir in walkDir("./vendor"):
if dir.kind == pcDir:
switch("path", dir.path)
switch("path", dir.path / "src")
# Add all vendor paths starting from the root vendor directory
addVendorPaths("./vendor")
switch("path", "./vendor/nim-nat-traversal")
switch("path", "./vendor/nim-nat-traversal/vendor/libnatpmp-upstream")
switch("path", "./vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc")
# disable timestamps in Windows PE headers - https://wiki.debian.org/ReproducibleBuilds/TimestampsInPEBinaries
switch("passL", "-Wl,--no-insert-timestamp")