Fix lib version regex

This commit is contained in:
Ganesh Viswanathan 2020-05-10 01:49:05 -05:00
commit 865ac56c20
3 changed files with 11 additions and 13 deletions

View file

@ -82,10 +82,8 @@ task test, "Test":
# getHeader tests # getHeader tests
withDir("tests"): withDir("tests"):
exec "nim e getheader.nims" exec "nim e getheader.nims"
when not defined(Windows): if not existsEnv("APPVEYOR"):
# Skip on Windows since very slow exec "nim e wrappers.nims"
if not existsEnv("APPVEYOR"):
exec "nim e wrappers.nims"
docsTask() docsTask()

View file

@ -859,11 +859,11 @@ proc buildLibrary(lname, outdir, conFlags, cmakeFlags, makeFlags: string, buildT
proc getDynlibExt(): string = proc getDynlibExt(): string =
when defined(Windows): when defined(Windows):
result = ".dll" result = "[0-9.\\-]*\\.dll"
elif defined(linux) or defined(FreeBSD): elif defined(linux) or defined(FreeBSD):
result = ".so[0-9.]*" result = "\\.so[0-9.]*"
elif defined(macosx): elif defined(macosx):
result = ".dylib[0-9.]*" result = "\\.dylib[0-9.]*"
var var
gDefines {.compileTime.} = initTable[string, string]() gDefines {.compileTime.} = initTable[string, string]()
@ -1007,7 +1007,7 @@ macro getHeader*(header: static[string], giturl: static[string] = "", dlurl: sta
preBuild = newIdentNode(name & "PreBuild") preBuild = newIdentNode(name & "PreBuild")
# Regex for library search # Regex for library search
lre = "(lib)?$1[_-]?(static)?[0-9.\\-]*\\" lre = "(lib)?$1[_-]?(static)?"
# If -d:xxx set with setDefines() # If -d:xxx set with setDefines()
stdVal = gDefines.hasKey(stdStr) stdVal = gDefines.hasKey(stdStr)

View file

@ -35,11 +35,6 @@ when defined(posix):
testCall(cmd & " -d:lzmaGit -d:lzmaSetVer=v5.2.0" & lrcmd, lexp & "5.2.0", 0) testCall(cmd & " -d:lzmaGit -d:lzmaSetVer=v5.2.0" & lrcmd, lexp & "5.2.0", 0)
testCall(cmd & " -d:lzmaGit -d:lzmaStatic -d:lzmaSetVer=v5.2.0" & lrcmd, lexp & "5.2.0", 0, delete = false) testCall(cmd & " -d:lzmaGit -d:lzmaStatic -d:lzmaSetVer=v5.2.0" & lrcmd, lexp & "5.2.0", 0, delete = false)
# dl - remove from Windows to save some time
testCall(cmd & " -d:lzmaDL" & lrcmd, "Need version", 1)
testCall(cmd & " -d:lzmaDL -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0)
testCall(cmd & " -d:lzmaDL -d:lzmaStatic -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0, delete = false)
# git # git
testCall(cmd & " -d:envTest" & zrcmd, zexp, 0) testCall(cmd & " -d:envTest" & zrcmd, zexp, 0)
testCall(cmd & " -d:envTestStatic" & zrcmd, zexp, 0, delete = false) testCall(cmd & " -d:envTestStatic" & zrcmd, zexp, 0, delete = false)
@ -48,6 +43,11 @@ testCall(cmd & " -d:envTestStatic" & zrcmd, zexp, 0, delete = false)
testCall(cmd & " -d:zlibGit -d:zlibSetVer=v1.2.10" & zrcmd, zexp & "1.2.10", 0) testCall(cmd & " -d:zlibGit -d:zlibSetVer=v1.2.10" & zrcmd, zexp & "1.2.10", 0)
testCall(cmd & " -d:zlibGit -d:zlibStatic -d:zlibSetVer=v1.2.10" & zrcmd, zexp & "1.2.10", 0, delete = false) testCall(cmd & " -d:zlibGit -d:zlibStatic -d:zlibSetVer=v1.2.10" & zrcmd, zexp & "1.2.10", 0, delete = false)
# dl
testCall(cmd & " -d:lzmaDL" & lrcmd, "Need version", 1)
testCall(cmd & " -d:lzmaDL -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0)
testCall(cmd & " -d:lzmaDL -d:lzmaStatic -d:lzmaSetVer=5.2.4" & lrcmd, lexp & "5.2.4", 0, delete = false)
# dl # dl
testCall(cmd & " -d:zlibDL -d:zlibSetVer=1.2.11" & zrcmd, zexp & "1.2.11", 0) testCall(cmd & " -d:zlibDL -d:zlibSetVer=1.2.11" & zrcmd, zexp & "1.2.11", 0)
testCall(cmd & " -d:zlibDL -d:zlibStatic -d:zlibSetVer=1.2.11" & zrcmd, zexp & "1.2.11", 0, delete = false) testCall(cmd & " -d:zlibDL -d:zlibStatic -d:zlibSetVer=1.2.11" & zrcmd, zexp & "1.2.11", 0, delete = false)