Skip to content

Commit f521cbf

Browse files
Install OpenSSL 3.5 on Windows
1 parent f0f247c commit f521cbf

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

.github/workflows/windows.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ jobs:
8080
with:
8181
arch: ${{ matrix.os.architecture }}
8282

83+
- name: 💾 Download OpenSSL 3.x
84+
uses: ethanjli/[email protected]
85+
with:
86+
url: "https://slproweb.com/download/Win64${{ matrix.os.architecture == 'arm64' && 'ARM' || '' }}OpenSSL-3_5_0.exe"
87+
destination: .\installer\openssl.exe
88+
cache-key: OpenSSL
89+
90+
- name: 📥 Install OpenSSL 3.x
91+
shell: powershell
92+
run: |
93+
Start-Process -FilePath ".\installer\openssl.exe" -ArgumentList "/silent", "/verysilent", "/sp-", "/suppressmsgboxes", "/DIR=C:\OpenSSL" -Wait
94+
echo "OPENSSL_ROOT_DIR=C:\OpenSSL" >> $env:GITHUB_ENV
95+
8396
- name: 💾 Download Pre-Build Dependencies
8497
id: dependencies
8598
uses: ./.github/actions/download-pre-built-deps

cmake/windows/BundleWindows.cmake.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,22 @@ if(EXISTS @CMAKE_BINARY_DIR@/bin/@PROJECT_NAME@@CMAKE_EXECUTABLE_SUFFIX@)
8080
endif()
8181

8282
foreach(comp "ssl" "crypto")
83-
find_file(${comp}
83+
find_file(lib${comp}
8484
NAMES
8585
"lib${comp}${open_ssl_version_suffix}.dll"
8686
PATHS
8787
"@_OPENSSL_ROOT_PATHS@"
88+
HINTS
89+
"@OPENSSL_ROOT_DIR@"
90+
$ENV{OPENSSL_ROOT_DIR}
8891
PATH_SUFFIXES
8992
bin
9093
)
9194

92-
if(comp)
95+
if(lib${comp})
9396
file(INSTALL
9497
FILES
95-
${${comp}}
98+
${lib${comp}}
9699
DESTINATION
97100
"${CMAKE_INSTALL_PREFIX}/bin"
98101
)

libsrc/webserver/CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@ if(ENABLE_MDNS)
4545
target_link_libraries(webserver mdns)
4646
endif()
4747

48-
# OpenSSL is only found correctly under ARM windows from CMake 4.1 onwards.
49-
# To fix this until the release of CMake 4.1, Hyperion contains a customized OpenSSL find script.
50-
if(WIN32 AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|ARM64|arm64" AND CMAKE_VERSION VERSION_LESS "4.1.0")
51-
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/windows/openssl)
52-
endif()
53-
54-
find_package(OpenSSL QUIET)
55-
if(OPENSSL_FOUND AND TARGET OpenSSL::SSL AND TARGET OpenSSL::Crypto)
56-
target_link_libraries(webserver
57-
OpenSSL::SSL
58-
OpenSSL::Crypto
59-
)
60-
endif()
61-
6248
if(NOT CMAKE_VERSION VERSION_LESS "3.15")
6349
set_target_properties(webserver PROPERTIES
6450
ADDITIONAL_CLEAN_FILES ${CMAKE_BINARY_DIR}/WebConfig.qrc

src/hyperiond/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ if(WIN32 AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|ARM64|arm64" AND CMAKE_V
6464
endif()
6565

6666
find_package(OpenSSL QUIET)
67+
6768
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS DBus QUIET)
6869
target_link_libraries(${PROJECT_NAME}
6970
commandline
@@ -228,17 +229,20 @@ if(WIN32 AND NOT DEFINED ENV{GITHUB_ACTIONS})
228229
endif()
229230

230231
foreach(comp "ssl" "crypto")
231-
find_file(${comp}
232+
find_file(lib${comp}
232233
NAMES
233234
"lib${comp}${open_ssl_version_suffix}.dll"
234235
PATHS
235236
${_OPENSSL_ROOT_PATHS}
237+
HINTS
238+
${OPENSSL_ROOT_DIR}
239+
$ENV{OPENSSL_ROOT_DIR}
236240
PATH_SUFFIXES
237241
bin
238242
)
239243

240244
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
241-
COMMAND ${CMAKE_COMMAND} -E copy ${${comp}} $<TARGET_FILE_DIR:${PROJECT_NAME}>
245+
COMMAND ${CMAKE_COMMAND} -E copy ${lib${comp}} $<TARGET_FILE_DIR:${PROJECT_NAME}>
242246
)
243247
endforeach()
244248
endif()

0 commit comments

Comments
 (0)