Add binarybuilder.org support, conan improvements, headerLDeps

This commit is contained in:
Ganesh Viswanathan 2020-06-15 21:37:35 -05:00
commit 2b3b5e2bec
7 changed files with 437 additions and 101 deletions

View file

@ -23,6 +23,7 @@ var
testCall(cmd & lrcmd, "No build files found", 1)
testCall(cmd & " -d:libssh2Conan" & sshcmd, "Need version for Conan uri", 1)
testCall(cmd & " -d:libssh2JBB" & sshcmd, "Need version for BinaryBuilder.org uri", 1)
when defined(posix):
# stdlib
@ -43,6 +44,11 @@ else:
# conan static for Windows
testCall(cmd & " -d:zlibConan -d:zlibSetVer=1.2.11 -d:zlibStatic" & zrcmd, zexp, 0)
# JBB
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)
# git
testCall(cmd & " -d:envTest" & zrcmd, zexp, 0)
testCall(cmd & " -d:envTestStatic" & zrcmd, zexp, 0, delete = false)

View file

@ -6,6 +6,7 @@ const
getHeader(
header = "libssh2.h",
conanuri = "libssh2/$1",
jbburi = "libssh2/$1",
outdir = outdir
)
@ -14,16 +15,16 @@ cOverride:
stat = object
stat64 = object
SOCKET = object
when not libssh2Static:
cImport(libssh2Path, recurse = true, dynlib = "libssh2LPath", flags = "-f:ast2 -c -E_ -F_")
when not defined(Windows):
when not defined(Windows) and not isDefined(libssh2JBB):
proc zlibVersion(): cstring {.importc, dynlib: libssh2LPath.}
else:
cImport(libssh2Path, recurse = true, flags = "-f:ast2 -c -E_ -F_")
when not defined(Windows):
when not defined(Windows) and not isDefined(libssh2JBB):
proc zlibVersion(): cstring {.importc.}
{.passL: "-lpthread".}
@ -39,8 +40,11 @@ if session == nil:
libssh2_session_set_blocking(session, 0.cint)
echo "zlib version = " & (block:
when not defined(Windows):
when not defined(Windows) and not isDefined(libssh2JBB):
$zlibVersion()
else:
""
)
)
static:
echo libssh2LDeps

View file

@ -28,6 +28,7 @@ getHeader(
giturl = "https://github.com/madler/zlib",
dlurl = "http://zlib.net/zlib-$1.tar.gz",
conanuri = "zlib/$1",
jbburi = "zlib/$1",
outdir = baseDir,
altNames = "z,zlib"
)
@ -72,3 +73,6 @@ else:
cImport(zlibPath, recurse = true, flags = FLAGS)
echo "zlib version = " & $zlibVersion()
when isDefined(zlibJBB) and isDefined(zlibStatic):
{.passL: "-no-pie".}