Prevent plugin outdir override by configuration
This commit is contained in:
parent
c57666d5db
commit
2060c8964d
2 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue