Skip to content

Commit

Permalink
Publish Windows on Arm build (#3452)
Browse files Browse the repository at this point in the history
* Fix _qt_paths generation

* Workaround QtMultimedia only needed for 6.4.0 only

* Simplify QT_PATHS generation now that STELLARIUM_BUILD_ARM64 is used

* Require Qt 6.5.0 or higher for Windows on ARM builds

* Do not add OpenSSL to Windows ARM64 installer

* [publish] Add qtpaths.bat workaround

* [publish] Do not copy OpenGL ES binaries in Qt 6 builds
  • Loading branch information
hmartinez82 authored Oct 14, 2023
1 parent f7de3ec commit 3283c67
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
12 changes: 6 additions & 6 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ environment:
msvcname: Visual Studio 15 2017
cmake_args:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
qtver: 6.5
qtver: 6.5.2
qtbin: msvc2019_arm64
msvcname: Visual Studio 17 2022
cmake_args: -A ARM64 -DSTELLARIUM_BUILD_ARM64=ON -DQT_HOST_PATH=C:/Qt/6.5/msvc2019_64 -DQT_PATHS=C:/Qt/6.5/msvc2019_arm64/bin/qtpaths.bat -DENABLE_QTWEBENGINE=OFF
cmake_args: -A ARM64 -DSTELLARIUM_BUILD_ARM64=ON -DQT_HOST_PATH=C:/Qt/6.5.2/msvc2019_64 -DENABLE_QTWEBENGINE=OFF -DENABLE_NLS=OFF -DQT_PATHS=%APPVEYOR_BUILD_FOLDER%/util/qtpaths_workaround.bat

before_build:
- ps: if($env:qtbin.contains('_64')) { $env:BITS=64 } else { $env:BITS=32 }
- ps: if($env:qtver.contains('6.')) { $env:SSL="OpenSSL-" } else { $env:SSL="OpenSSL-1-" }
- ps: if($env:qtver.startsWith('6.')) { $env:SSL="OpenSSL-" } else { $env:SSL="OpenSSL-1-" }
- set PUBLISH_BINARY=false
- set USE_EXT_LIBGLES=false
- set SIGNING=false
Expand All @@ -54,9 +54,9 @@ before_build:
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-oldstable") { $env:PUBLISH_BINARY = 'true' }
- ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.contains('[publish]')) { $env:PUBLISH_BINARY = 'true' }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-next" -or $env:APPVEYOR_REPO_COMMIT_MESSAGE.contains('[publish]')) { $env:USE_EXTRA_EXE = 'true' } else { $env:USE_EXTRA_EXE = 'false' }
- ps: if($env:PUBLISH_BINARY -eq "true" -and $env:qtver.contains('5.')) { $env:USE_EXT_LIBGLES = 'true' }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-stable" -and $env:qtver.contains('6.')) { $env:SIGNING = 'true' }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-oldstable" -and $env:qtver.contains('5.')) { $env:SIGNING = 'true' }
- ps: if($env:PUBLISH_BINARY -eq "true" -and $env:qtver.startsWith('5.')) { $env:USE_EXT_LIBGLES = 'true' }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-stable" -and $env:qtver.startsWith('6.')) { $env:SIGNING = 'true' }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-oldstable" -and $env:qtver.startsWith('5.')) { $env:SIGNING = 'true' }
- if [%PUBLISH_BINARY%]==[true] appveyor DownloadFile https://github.com/Stellarium/stellarium-data/releases/download/guide/guide.pdf -FileName c:\stellarium\guide\guide.pdf
- if [%PUBLISH_BINARY%]==[true] mkdir c:\stellarium-OpenSSL
- if [%PUBLISH_BINARY%]==[true] set PATH=C:\stellarium-OpenSSL;%PATH%
Expand Down
26 changes: 16 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -603,17 +603,23 @@ IF(WIN32)
FIND_FILE(OPENSSL_CRYPTO_LIBRARY_DLL libcrypto-1_1${OPENSSL_LIBRARY_ARCH}.dll)
ENDIF()

SET(ISS_OPENSSL_LIBS "; OpenSSL support")
IF(EXISTS ${OPENSSL_SSL_LIBRARY_DLL})
MESSAGE(STATUS "Found OpenSSL SSL library: ${OPENSSL_SSL_LIBRARY_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_SSL_LIBRARY_DLL}\"; DestDir: \"{app}\"; Flags: ignoreversion")
IF(NOT STELLARIUM_BUILD_ARM64)
SET(ISS_OPENSSL_LIBS "; OpenSSL support")
IF(EXISTS ${OPENSSL_SSL_LIBRARY_DLL})
MESSAGE(STATUS "Found OpenSSL SSL library: ${OPENSSL_SSL_LIBRARY_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_SSL_LIBRARY_DLL}\"; DestDir: \"{app}\"; Flags: ignoreversion")
ENDIF()
IF(EXISTS ${OPENSSL_CRYPTO_LIBRARY_DLL})
MESSAGE(STATUS "Found OpenSSL crypto library: ${OPENSSL_CRYPTO_LIBRARY_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_CRYPTO_LIBRARY_DLL}\"; DestDir: \"{app}\"; Flags: ignoreversion")
ENDIF()
IF((NOT EXISTS ${OPENSSL_SSL_LIBRARY_DLL}) AND (NOT EXISTS ${OPENSSL_CRYPTO_LIBRARY_DLL}))
SET(ISS_OPENSSL_LIBS "; OpenSSL libraries not found")
ENDIF()
ENDIF()
IF(EXISTS ${OPENSSL_CRYPTO_LIBRARY_DLL})
MESSAGE(STATUS "Found OpenSSL crypto library: ${OPENSSL_CRYPTO_LIBRARY_DLL}")
SET(ISS_OPENSSL_LIBS "${ISS_OPENSSL_LIBS}\nSource: \"${OPENSSL_CRYPTO_LIBRARY_DLL}\"; DestDir: \"{app}\"; Flags: ignoreversion")
ENDIF()
IF((NOT EXISTS ${OPENSSL_SSL_LIBRARY_DLL}) AND (NOT EXISTS ${OPENSSL_CRYPTO_LIBRARY_DLL}))
SET(ISS_OPENSSL_LIBS "; OpenSSL libraries not found")

IF(STELLARIUM_BUILD_ARM64 AND ${QT_VERSION} VERSION_LESS "6.5.0")
MESSAGE(FATAL_ERROR "Qt 6.5.0 or later is required for Windows on ARM builds.")
ENDIF()
ENDIF()

Expand Down
14 changes: 9 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ IF(APPLE)
)
ENDIF()
# workaround for https://bugreports.qt.io/browse/QTBUG-105984
IF(ENABLE_MEDIA AND (${QT_VERSION} VERSION_GREATER_EQUAL "6.4.0"))
IF(ENABLE_MEDIA AND (${QT_VERSION} VERSION_EQUAL "6.4.0"))
GET_FILENAME_COMPONENT(_qt_bin_dir "${MACDEPLOYQT_COMMAND}" DIRECTORY)
INSTALL(FILES ${_qt_bin_dir}/../plugins/multimedia/libdarwinmediaplugin.dylib DESTINATION PlugIns/multimedia)
ENDIF()
Expand All @@ -611,10 +611,14 @@ IF(WIN32)
SET(VIRTUAL_KBD_SETTING "--no-virtualkeyboard")
ENDIF()

IF("${QT_PATHS}" STREQUAL "")
SET(_qt_paths "")
# Use external workaround until https://github.com/appveyor/ci/issues/3892 is addressed
# IF(STELLARIUM_BUILD_ARM64)
# cmake_path(APPEND QT_PATHS ${QT6_INSTALL_PREFIX} "bin" "qtpaths.bat")
# ENDIF()
IF(QT_PATHS)
SET(_qt_paths "--qtpaths \"${QT_PATHS}\"")
ELSE()
SET(_qt_paths "--qtpaths \"${QTPATHS}\"")
SET(_qt_paths "")
ENDIF()

INSTALL(CODE
Expand Down Expand Up @@ -653,7 +657,7 @@ IF(WIN32)
)
ENDIF()
# workaround for https://bugreports.qt.io/browse/QTBUG-105984
IF(ENABLE_MEDIA AND (${QT_VERSION} VERSION_GREATER_EQUAL "6.4.0"))
IF(ENABLE_MEDIA AND (${QT_VERSION} VERSION_EQUAL "6.4.0"))
GET_FILENAME_COMPONENT(_qt_bin_dir "${WINDEPLOYQT_COMMAND}" DIRECTORY)
INSTALL(FILES ${_qt_bin_dir}/../plugins/multimedia/windowsmediaplugin.dll DESTINATION ${CMAKE_INSTALL_PREFIX}/qtstuff/multimedia)
ENDIF()
Expand Down
2 changes: 2 additions & 0 deletions util/qtpaths_workaround.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
C:\Qt\6.5.2\msvc2019_64\bin\qtpaths6.exe -qtconf "C:\Qt\6.5.2\msvc2019_arm64\bin\target_qt.conf" %*

0 comments on commit 3283c67

Please sign in to comment.