Subject: Re: Removing non-CMake windows support (was Re: problems building under Windows)

Re: Removing non-CMake windows support (was Re: problems building under Windows)

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Sat, 2 Jan 2016 11:12:02 +0000

On 2 January 2016 at 00:35, Jan Ehrhardt <phpdev_at_ehrhardt.nl> wrote:
> Alexander Lamaison in gmane.network.ssh.libssh2.devel (Fri, 1 Jan 2016
> 15:46:41 +0000):
>>On 21 December 2015 at 10:32, Jan Ehrhardt <phpdev_at_ehrhardt.nl> wrote:
>>> The VC-projects are used for compiling libssh2 as a dependency for PHP 5
>>> and PHP 7: https://github.com/winlibs/libssh2
>>>
>>> I would not advice to remove them.
>>
>>Could PHP not use VC projects via CMake?
>
> TLDR: CMake sort of works

Thanks for your detailed feedback.

> CMake (on Windows) is notoriously stubborn when it comes to finding
> libraries. I had to upgrade to CMake 3.4.1 (was 3.2.2) to be able to
> manually specify the location of the OpenSSL library:
> -D"OPENSSL_ROOT_DIR=/php-sdk/win64build.vc14" for 64-bits VC14 libs
> -D"OPENSSL_ROOT_DIR=/php-sdk/win64build.vc11" for 64-bits VC11 libs

With CMake 3.2, what was happening? Was it failing to find any
OpenSSL, or was it finding the wrong one?

> But the same trick for Zlib did not work:
> -D"ZLIB_ROOT=/php-sdk/win64build.vc14"

As you've since discovered, compression is an optional feature that
you have to explicitly enable. If you don't enable it, you don't need
zlib so the build doesn't even look for it. You might not be expecting
this because the default for the autotools build is to use encryption
if zlib can be found. Would you prefer the CMake build to do this
also?

> Moreover CMake falsely #undef's HAVE_SNPRINTF in VC14. VC14 aka VS2015
> does have a snprintf, so you will have to manually add #define
> HAVE_SNPRINTF to libssh2_config.h

Are you using the latest from git? This should have been fixed in
https://github.com/libssh2/libssh2/commit/af14462d535a2b061a77d31d60734ebb558aca16

Alex

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2016-01-02