summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharlie Barto <bartoc@umich.edu>2017-12-06 03:56:44 -0500
committerAndreas Rumpf <rumpf_a@web.de>2017-12-06 09:56:44 +0100
commitc7ba4d91a34882e94969595ba70763f9f642423c (patch)
tree9d8fa8de67578623f51bd239497792eff472b2d6
parent6ee08cf70c9461972cfcf179e12669b5518977ff (diff)
downloadNim-c7ba4d91a34882e94969595ba70763f9f642423c.tar.gz
add dynlibOverrideAll switch (#6873)
-rw-r--r--compiler/commands.nim3
-rw-r--r--compiler/options.nim3
-rw-r--r--doc/advopt.txt1
3 files changed, 6 insertions, 1 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 11a66cf55..de474c6e6 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -654,6 +654,9 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
     gListFullPaths = true
   of "dynliboverride":
     dynlibOverride(switch, arg, pass, info)
+  of "dynliboverrideall":
+    expectNoArg(switch, arg, pass, info)
+    gDynlibOverrideAll = true
   of "cs":
     # only supported for compatibility. Does nothing.
     expectArg(switch, arg, pass, info)
diff --git a/compiler/options.nim b/compiler/options.nim
index eec9ce448..8c4fe485e 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -145,6 +145,7 @@ var
   gNoNimblePath* = false
   gExperimentalMode*: bool
   newDestructors*: bool
+  gDynlibOverrideAll*: bool
 
 proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
 proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc
@@ -427,7 +428,7 @@ proc inclDynlibOverride*(lib: string) =
   gDllOverrides[lib.canonDynlibName] = "true"
 
 proc isDynlibOverride*(lib: string): bool =
-  result = gDllOverrides.hasKey(lib.canonDynlibName)
+  result = gDynlibOverrideAll or gDllOverrides.hasKey(lib.canonDynlibName)
 
 proc binaryStrSearch*(x: openArray[string], y: string): int =
   var a = 0
diff --git a/doc/advopt.txt b/doc/advopt.txt
index 60fd081b8..ab10d65ba 100644
--- a/doc/advopt.txt
+++ b/doc/advopt.txt
@@ -79,6 +79,7 @@ Advanced options:
                             symbol matching is fuzzy so
                             that --dynlibOverride:lua matches
                             dynlib: "liblua.so.3"
+  --dynlibOverrideAll       makes the dynlib pragma have no effect
   --listCmd                 list the commands used to execute external programs
   --parallelBuild:0|1|...   perform a parallel build
                             value = number of processors (0 for auto-detect)