Fix lib copy issue

This commit is contained in:
Ganesh Viswanathan 2020-06-16 20:41:32 -05:00
commit c359cc0226
3 changed files with 22 additions and 3 deletions

View file

@ -252,6 +252,17 @@ proc getFileDate*(fullpath: string): string =
(result, ret) = execAction(cmd)
proc touchFile*(fullpath: string) =
## Touch file to update modified date
var
cmd =
when defined(Windows):
&"cmd /c copy /b {fullpath.sanitizePath}+"
else:
&"touch {fullpath.sanitizePath}"
discard execAction(cmd)
proc getProjectCacheDir*(name: string, forceClean = true): string =
## Get a cache directory where all nimterop artifacts can be stored
##
@ -1367,19 +1378,22 @@ macro getHeader*(
`ldeps`* = block:
var
ldeps = ldeps
copied: seq[string]
for i in 0 ..< ldeps.len:
let
lname = ldeps[i].extractFilenameStatic()
ldeptgt = joinPathStatic(`libdir`, lname)
if not fileExists(ldeptgt) or getFileDate(ldeps[i]) > getFileDate(ldeptgt):
echo "# Copying " & lname & " to " & `libdir`
if not fileExists(ldeptgt) or getFileDate(ldeps[i]) != getFileDate(ldeptgt):
cpFile(ldeps[i], ldeptgt, psymlink = true)
copied.add lname
ldeps[i] = ldeptgt
if copied.len != 0:
echo "# Copying dependencies: " & copied.join(" ") & "\n# to " & `libdir`
ldeps
static:
# Copy shared libraries and dependencies to `libdir`
if not fileExists(`lpath`) or getFileDate(lpath) > getFileDate(`lpath`):
if not fileExists(`lpath`) or getFileDate(lpath) != getFileDate(`lpath`):
echo "# Copying " & `lpath`.extractFilenameStatic() & " to " & `libdir`
cpFile(lpath, `lpath`)

View file

@ -346,6 +346,8 @@ proc downloadConan*(pkg: ConanPackage, outdir: string, clean = true) =
elif clean:
cleanDir(outdir)
echo &"# Downloading {pkg.name} v{pkg.version} from Conan"
pkg.getConanBuilds()
doAssert pkg.recipes.len != 0, &"Failed to download {pkg.name} v{pkg.version} from Conan - check https://conan.io/center"

View file

@ -40,6 +40,7 @@ when defined(posix):
# conan static
testCall(cmd & " -d:libssh2Conan -d:libssh2SetVer=1.9.0 -d:libssh2Static" & sshcmd, zexp, 0)
<<<<<<< HEAD
else:
# conan static for Windows
testCall(cmd & " -d:zlibConan -d:zlibSetVer=1.2.11 -d:zlibStatic" & zrcmd, zexp, 0)
@ -48,6 +49,8 @@ else:
testCall(cmd & " -d:libssh2JBB -d:libssh2SetVer=1.9.0" & sshcmd, zexp, 0)
testCall(cmd & " -d:zlibJBB -d:zlibSetVer=1.2.11" & zrcmd, zexp, 0)
testCall(cmd & " -d:zlibJBB -d:zlibSetVer=1.2.11 -d:zlibStatic" & zrcmd, zexp, 0)
=======
>>>>>>> c35eb74... Add tests for conan, recurse implies preprocess
# git
testCall(cmd & " -d:envTest" & zrcmd, zexp, 0)