OpenSSL: Fix compilation on windows msvc and ninja#461
OpenSSL: Fix compilation on windows msvc and ninja#461dan-42 wants to merge 1 commit intocpp-pm:masterfrom
Conversation
|
|
||
|
|
||
| execute_process(COMMAND | ||
| perl Configure @arch@ @opt@ @shared@ "--prefix=@openssl_install_dir@" "--openssldir=@openssl_dir@" RESULT_VARIABLE result) |
There was a problem hiding this comment.
I've found that the perl command will fail depending on whether it is the mingw perl (failure) or the Strawberry/Windows perl (success). Can we fix that too?
There was a problem hiding this comment.
@rbsheth
Sure
I did not look to close into it.
But it looks like the command expects a linux bash but in fact it is a windows cmd
Not yet sure how to solve that, but I'm also not so familiar with mingw and I need to set it up first.
|
@rbsheth Thanks for commenting I discovered (working on my toy project) when running So I still suspect somehow CMake or some other entity doing something funny. |
|
Sorry, I haven't taken a look in a while. But I suspect something more fundamental is going on here |
|
@rbsheth no worries, I also could not find the time to look more into this. But as the OpenSSL's perl-script is figuring things out on it's own (which does go wrong) and there is your point, that it will depend on the installed perl-version (Strawberry or mingw) maybe that is the root cause and we just need to differentiate between those two. |
|
Found an interesting project which wraps the OpenSSL build instructions with CMake: https://github.com/viaduck/openssl-cmake/blob/v3/cmake/BuildOpenSSL.cmake Maybe some references on how to fix our builds could be taken |
I've followed this guide
step by step carefully. [Yes]
This update will fix a toolchain.
The issue boils down that
url_sha1_openssl_windows_1_1_plus.cmakecallsconfigure_1_1_plus.cmakeAnd CMake populates
CXX,CCand other environment variables.The build fails because, the content of these variables are absolute file paths without any quotes and they are not escaped.
But openssl will use them and fails upon calling them.
The same goes for many other projects (e.g. Boost during b2) and I created this PR to show it for openssl* and get a conversation going.
My guess is that CMake actually sets these variables wrong, or Hunter should set them manually.
So I'm hoping for some feedback on how this might be solved in a better more general way.
*) unfortunately since the last version of hunter, the CI does not run the builds anymore 🤷