aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nimterop.nimble2
-rw-r--r--nimterop/getters.nim8
2 files changed, 8 insertions, 2 deletions
diff --git a/nimterop.nimble b/nimterop.nimble
index a6fba1e..e520c71 100644
--- a/nimterop.nimble
+++ b/nimterop.nimble
@@ -10,7 +10,7 @@ installDirs = @["nimterop"]
installFiles = @["config.nims"]
# Dependencies
-requires "nim >= 0.20.2", "regex#v0.13.1", "cligen >= 0.9.43"
+requires "nim >= 0.20.2", "regex >= 0.14.1", "cligen >= 0.9.45"
import nimterop/docs
diff --git a/nimterop/getters.nim b/nimterop/getters.nim
index d829cf0..ebd3432 100644
--- a/nimterop/getters.nim
+++ b/nimterop/getters.nim
@@ -731,7 +731,13 @@ proc loadPlugin*(gState: State, sourcePath: string) =
flags =
if fileExists(sourcePath & ".cfg"): ""
else: getNimConfigFlags(getCurrentDir())
- cmd = &"{gState.nim.sanitizePath} c --app:lib --gc:markAndSweep {flags} {sourcePath.sanitizePath}"
+
+ # Always set output to same directory as source, prevents override
+ outflags = &"--out:\"{pdll.extractFilename()}\" --outdir:\"{pdll.parentDir()}\""
+
+ # Compile plugin as library with `markAndSweep` GC
+ cmd = &"{gState.nim.sanitizePath} c --app:lib --gc:markAndSweep {flags} {outflags} {sourcePath.sanitizePath}"
+
discard execAction(cmd)
doAssert fileExists(pdll), "No plugin binary generated for " & sourcePath