mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 05:04:38 +03:00
Allow --autodesktop to autoinstall desktop qt for qt6/wasm.
Apparently, Qt6 for wasm does not ship with qmake, so CI must install it. This change leverages `--autodesktop` for that purpose.
This commit is contained in:
@@ -304,7 +304,7 @@ class Cli:
|
||||
base_path = Path(base_dir)
|
||||
|
||||
expect_desktop_archdir, autodesk_arch = self._get_autodesktop_dir_and_arch(
|
||||
should_autoinstall, os_name, target, base_path, _version
|
||||
should_autoinstall, os_name, target, base_path, _version, is_wasm=(arch.startswith("wasm"))
|
||||
)
|
||||
|
||||
auto_desktop_archives: List[QtPackage] = (
|
||||
@@ -628,7 +628,7 @@ class Cli:
|
||||
install_qt_parser.add_argument(
|
||||
"--autodesktop",
|
||||
action="store_true",
|
||||
help="For android/ios installations, a desktop Qt installation is required. "
|
||||
help="For android, ios, and Qt6/wasm installations, a standard desktop Qt installation is required. "
|
||||
"When enabled, this option installs the required desktop version automatically.",
|
||||
)
|
||||
|
||||
@@ -970,10 +970,14 @@ class Cli:
|
||||
raise CliInputError(f"Invalid version: '{version_str}'! Please use the form '5.X.Y'.") from e
|
||||
|
||||
def _get_autodesktop_dir_and_arch(
|
||||
self, should_autoinstall: bool, host: str, target: str, base_path: Path, version: Version
|
||||
self, should_autoinstall: bool, host: str, target: str, base_path: Path, version: Version, is_wasm: bool = False
|
||||
) -> Tuple[Optional[str], Optional[str]]:
|
||||
"""Returns expected_desktop_arch_dir, desktop_arch_to_install"""
|
||||
if target in ["ios", "android"]:
|
||||
is_wasm_qt6 = target == "desktop" and is_wasm and version >= Version("6.0.0")
|
||||
if target not in ["ios", "android"] and not is_wasm_qt6:
|
||||
# We do not need to worry about the desktop directory if target is not mobile, or it's not Qt6 wasm.
|
||||
return None, None
|
||||
|
||||
installed_desktop_arch_dir = QtRepoProperty.find_installed_desktop_qt_dir(host, base_path, version)
|
||||
if installed_desktop_arch_dir:
|
||||
# An acceptable desktop Qt is already installed, so don't do anything.
|
||||
@@ -997,9 +1001,6 @@ class Cli:
|
||||
f" `aqt install-qt {host} desktop {version} {default_desktop_arch}`"
|
||||
)
|
||||
return expected_desktop_arch_path.name, None
|
||||
else:
|
||||
# We do not need to worry about the desktop directory if target is not mobile.
|
||||
return None, None
|
||||
|
||||
|
||||
def is_64bit() -> bool:
|
||||
|
||||
@@ -270,7 +270,8 @@ windows_build_jobs.append(
|
||||
BuildJob("install-qt", "5.14.2", "windows", "desktop", "wasm_32", "wasm_32")
|
||||
)
|
||||
windows_build_jobs.append(
|
||||
BuildJob("install-qt", "6.4.0", "windows", "desktop", "wasm_32", "wasm_32")
|
||||
BuildJob("install-qt", "6.4.0", "windows", "desktop", "wasm_32", "wasm_32",
|
||||
is_autodesktop=True, mingw_variant="win64_mingw900")
|
||||
)
|
||||
|
||||
# mobile SDK
|
||||
|
||||
@@ -364,7 +364,10 @@ steps:
|
||||
echo "$env:Path"
|
||||
if('$(QT_VERSION)' -like '6*') {
|
||||
echo "Qt6: run qmake.bat"
|
||||
qmake.bat $(Build.BinariesDirectory)\tests\openglwindow
|
||||
#qmake.bat $(Build.BinariesDirectory)\tests\openglwindow
|
||||
# nope, just inline the bat file:
|
||||
echo "Inlined command is: qmake -qtconf $(WIN_QT_BINDIR)\target_qt.conf $(Build.BinariesDirectory)\tests\openglwindow"
|
||||
"$(WIN_QT_BINDIR)\..\..\mingw_64\bin\qmake.exe" -qtconf "$(WIN_QT_BINDIR)\target_qt.conf" $(Build.BinariesDirectory)\tests\openglwindow
|
||||
} else {
|
||||
echo "Qt5: run qmake.exe"
|
||||
qmake $(Build.BinariesDirectory)\tests\openglwindow
|
||||
|
||||
Reference in New Issue
Block a user