diff --git a/config.nims b/config.nims index 25066dcb2..55597522f 100644 --- a/config.nims +++ b/config.nims @@ -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")