Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL: Fix compilation on windows msvc and ninja #461

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ if("@openssl_dir@" STREQUAL "")
message(FATAL_ERROR "openssl_dir is empty")
endif()

if("@MSVC@")
# Unset as we are already in a msvc environment
# and the openssl perl script will figure things out.
# The created variable content by CMake is unqouted and will cause issues
unset(ENV{CC})
unset(ENV{CXX})
unset(ENV{RC})
unset(ENV{AR})
unset(ENV{RUNLIB})
else()
set(log_opts "")
endif()


execute_process(COMMAND
perl Configure @arch@ @opt@ @shared@ "--prefix=@openssl_install_dir@" "--openssldir=@openssl_dir@" RESULT_VARIABLE result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ set(openssl_install_dir "@HUNTER_PACKAGE_INSTALL_PREFIX@")
# * opt
# * shared
# * NASM_ROOT
# * MSVC
configure_file(
"@HUNTER_PACKAGE_SETUP_DIR@/ep-stages/configure_1_1_plus.cmake.in"
"@HUNTER_PACKAGE_BUILD_DIR@/configure_1_1_plus.cmake"
Expand Down