Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ieb57137ee2b7d0c505e3531d5aa1bcb66978847e
This commit is contained in:
commit
c497f79ad4
44
mkspecs/features/data/dumpvcvars.bat
Normal file
44
mkspecs/features/data/dumpvcvars.bat
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
::
|
||||||
|
:: Copyright (C) 2018 The Qt Company Ltd.
|
||||||
|
:: Contact: https://www.qt.io/licensing/
|
||||||
|
::
|
||||||
|
:: This file is part of the tools applications of the Qt Toolkit.
|
||||||
|
::
|
||||||
|
:: $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||||
|
:: Commercial License Usage
|
||||||
|
:: Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
:: accordance with the commercial license agreement provided with the
|
||||||
|
:: Software or, alternatively, in accordance with the terms contained in
|
||||||
|
:: a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
:: and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
:: information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
::
|
||||||
|
:: GNU General Public License Usage
|
||||||
|
:: Alternatively, this file may be used under the terms of the GNU
|
||||||
|
:: General Public License version 3 as published by the Free Software
|
||||||
|
:: Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
:: included in the packaging of this file. Please review the following
|
||||||
|
:: information to ensure the GNU General Public License requirements will
|
||||||
|
:: be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
::
|
||||||
|
:: $QT_END_LICENSE$
|
||||||
|
::
|
||||||
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
REM We clear INCLUDE and LIB, because we want to obtain pristine values.
|
||||||
|
REM PATH cannot be cleared, because then the script does not even run,
|
||||||
|
REM and it would be counterproductive anyway (see toolchain.prf).
|
||||||
|
set INCLUDE=
|
||||||
|
set LIB=
|
||||||
|
|
||||||
|
call %* || exit 1
|
||||||
|
REM VS2015 does not set errorlevel in case of failure.
|
||||||
|
if "%INCLUDE%" == "" exit 1
|
||||||
|
|
||||||
|
echo =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
|
||||||
|
echo %INCLUDE%
|
||||||
|
echo %LIB%
|
||||||
|
echo %PATH%
|
@ -1,3 +1,124 @@
|
|||||||
|
defineTest(qtToolchainError) {
|
||||||
|
msg = \
|
||||||
|
$$1 \
|
||||||
|
"===================" \
|
||||||
|
$$2 \
|
||||||
|
"===================" \
|
||||||
|
$$3
|
||||||
|
error($$join(msg, $$escape_expand(\\n)))
|
||||||
|
}
|
||||||
|
|
||||||
|
defineTest(qtCompilerError) {
|
||||||
|
!cross_compile: \
|
||||||
|
what =
|
||||||
|
else: host_build: \
|
||||||
|
what = " host"
|
||||||
|
else: \
|
||||||
|
what = " target"
|
||||||
|
qtToolchainError("Cannot run$$what compiler '$$1'. Output:", $$2, \
|
||||||
|
"Maybe you forgot to setup the environment?")
|
||||||
|
}
|
||||||
|
|
||||||
|
cross_compile:host_build: \
|
||||||
|
target_prefix = QMAKE_HOST_CXX
|
||||||
|
else: \
|
||||||
|
target_prefix = QMAKE_CXX
|
||||||
|
|
||||||
|
#
|
||||||
|
# Determine and cache the compiler version
|
||||||
|
#
|
||||||
|
|
||||||
|
defineReplace(qtVariablesFromMSVC) {
|
||||||
|
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec)
|
||||||
|
!equals(ec, 0): qtCompilerError($$1, $$ret)
|
||||||
|
return($$ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
defineReplace(qtVariablesFromGCC) {
|
||||||
|
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \
|
||||||
|
2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
|
||||||
|
!equals(ec, 0): qtCompilerError($$1, $$ret)
|
||||||
|
return($$ret)
|
||||||
|
}
|
||||||
|
|
||||||
|
isEmpty($${target_prefix}.COMPILER_MACROS) {
|
||||||
|
msvc {
|
||||||
|
clang_cl {
|
||||||
|
# We need to obtain the cl.exe version first
|
||||||
|
vars = $$qtVariablesFromMSVC(cl)
|
||||||
|
for (v, vars) {
|
||||||
|
isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next()
|
||||||
|
eval($$v)
|
||||||
|
}
|
||||||
|
isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version")
|
||||||
|
|
||||||
|
QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \
|
||||||
|
"-fms-compatibility-version=\\1.\\2.\\3")
|
||||||
|
cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT)
|
||||||
|
$${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT
|
||||||
|
vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT)
|
||||||
|
} else {
|
||||||
|
vars = $$qtVariablesFromMSVC($$QMAKE_CXX)
|
||||||
|
}
|
||||||
|
} else: gcc|ghs {
|
||||||
|
vars = $$qtVariablesFromGCC($$QMAKE_CXX)
|
||||||
|
}
|
||||||
|
for (v, vars) {
|
||||||
|
!contains(v, "[A-Z_]+ = .*"): next()
|
||||||
|
# Set both <varname> for the outer scope ...
|
||||||
|
eval($$v)
|
||||||
|
v ~= s/ .*//
|
||||||
|
isEmpty($$v): error("Compiler produced empty value for $${v}.")
|
||||||
|
# ... and save QMAKE_(HOST_)?CXX.<varname> in the cache.
|
||||||
|
cache($${target_prefix}.$$v, set stash, $$v)
|
||||||
|
$${target_prefix}.COMPILER_MACROS += $$v
|
||||||
|
}
|
||||||
|
cache($${target_prefix}.COMPILER_MACROS, set stash)
|
||||||
|
} else {
|
||||||
|
# load from the cache
|
||||||
|
for (i, $${target_prefix}.COMPILER_MACROS): \
|
||||||
|
$$i = $$eval($${target_prefix}.$$i)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Populate QMAKE_COMPILER_DEFINES and some compatibility variables.
|
||||||
|
# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal.
|
||||||
|
QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX
|
||||||
|
!isEmpty(QMAKE_MSC_VER): \
|
||||||
|
QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER
|
||||||
|
!isEmpty(QMAKE_ICC_VER): \
|
||||||
|
QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER
|
||||||
|
!isEmpty(QMAKE_APPLE_CC): \
|
||||||
|
QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC
|
||||||
|
!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \
|
||||||
|
QMAKE_COMPILER_DEFINES += __clang__ \
|
||||||
|
__clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \
|
||||||
|
__clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \
|
||||||
|
__clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION
|
||||||
|
!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \
|
||||||
|
QMAKE_COMPILER_DEFINES += __clang__ \
|
||||||
|
__clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \
|
||||||
|
__clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \
|
||||||
|
__clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION
|
||||||
|
!isEmpty(QMAKE_GCC_MAJOR_VERSION): \
|
||||||
|
QMAKE_COMPILER_DEFINES += \
|
||||||
|
__GNUC__=$$QMAKE_GCC_MAJOR_VERSION \
|
||||||
|
__GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \
|
||||||
|
__GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION
|
||||||
|
!isEmpty(QMAKE_GHS_VERSION): \
|
||||||
|
QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION
|
||||||
|
|
||||||
|
QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
|
||||||
|
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
|
||||||
|
|
||||||
|
clang_cl|intel_icl {
|
||||||
|
include(../common/msvc-based-version.conf)
|
||||||
|
} else: msvc {
|
||||||
|
include(../common/msvc-version.conf)
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Determine and cache the default search paths
|
||||||
|
#
|
||||||
|
|
||||||
defineReplace(qtMakeExpand) {
|
defineReplace(qtMakeExpand) {
|
||||||
out = "$$1"
|
out = "$$1"
|
||||||
@ -9,26 +130,35 @@ defineReplace(qtMakeExpand) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineTest(qtCompilerError) {
|
defineReplace(qtSplitPathList) {
|
||||||
!cross_compile: \
|
paths = $$split(1, $$QMAKE_DIRLIST_SEP)
|
||||||
what =
|
ret =
|
||||||
else: host_build: \
|
for (p, paths): \
|
||||||
what = " host"
|
ret += $$clean_path($$p)
|
||||||
else: \
|
return($$ret)
|
||||||
what = " target"
|
|
||||||
msg = \
|
|
||||||
"Cannot run$$what compiler '$$1'. Output:" \
|
|
||||||
"===================" \
|
|
||||||
$$2 \
|
|
||||||
"===================" \
|
|
||||||
"Maybe you forgot to setup the environment?"
|
|
||||||
error($$join(msg, $$escape_expand(\\n)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cross_compile:host_build: \
|
defineReplace(qtNmakePathList) {
|
||||||
target_prefix = QMAKE_HOST_CXX
|
paths =
|
||||||
else: \
|
for (p, 1): \
|
||||||
target_prefix = QMAKE_CXX
|
paths += $$shell_path($$p)
|
||||||
|
paths ~= s,$${LITERAL_HASH},^$${LITERAL_HASH},g
|
||||||
|
paths ~= s,\\$,\$\$,g
|
||||||
|
return($$join(paths, $$QMAKE_DIRLIST_SEP))
|
||||||
|
}
|
||||||
|
|
||||||
|
msvc {
|
||||||
|
arch = $$lower($$VCPROJ_ARCH)
|
||||||
|
equals(arch, x64): \ # may be "win32" or undefined
|
||||||
|
arch = amd64
|
||||||
|
else: !equals(arch, arm):!equals(arch, arm64): \ # may be "win32" or undefined
|
||||||
|
arch = x86
|
||||||
|
# Consider only WinRT and ARM64 desktop builds to be cross-builds -
|
||||||
|
# the host is assumed to be Intel and capable of running the target
|
||||||
|
# executables (so building for x64 on x86 will break).
|
||||||
|
winrt|equals(arch, arm64): \
|
||||||
|
CONFIG += msvc_cross
|
||||||
|
}
|
||||||
|
|
||||||
isEmpty($${target_prefix}.INCDIRS) {
|
isEmpty($${target_prefix}.INCDIRS) {
|
||||||
#
|
#
|
||||||
@ -169,9 +299,89 @@ isEmpty($${target_prefix}.INCDIRS) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else: msvc_cross {
|
||||||
|
# Use a batch file, because %VAR% in the system() call expands to
|
||||||
|
# the pre-script-call value, and !VAR! cannot be enabled outside
|
||||||
|
# a batch file without invoking another shell instance.
|
||||||
|
cmd = $$system_quote($$system_path($$PWD/data/dumpvcvars.bat))
|
||||||
|
|
||||||
|
hostArch = $$QMAKE_HOST.arch
|
||||||
|
equals(hostArch, x86_64): \
|
||||||
|
hostArch = amd64
|
||||||
|
!equals(arch, $$hostArch): \
|
||||||
|
arch = $${hostArch}_$$arch
|
||||||
|
|
||||||
|
isEmpty(MSVC_VER): \
|
||||||
|
error("Mkspec does not specify MSVC_VER. Cannot continue.")
|
||||||
|
versionAtLeast(MSVC_VER, 15.0) {
|
||||||
|
dir = $$(VSINSTALLDIR)
|
||||||
|
isEmpty(dir): \
|
||||||
|
dir = $$read_registry(HKLM, \
|
||||||
|
"Software\\Microsoft\\VisualStudio\\SxS\\VS7\\$$MSVC_VER", 32)
|
||||||
|
isEmpty(dir): \
|
||||||
|
error("Failed to find the Visual Studio installation directory.")
|
||||||
|
cmd += $$system_quote($$dir\\VC\\Auxiliary\\Build\\vcvarsall.bat) $$arch
|
||||||
|
} else {
|
||||||
|
dir = $$(VCINSTALLDIR)
|
||||||
|
isEmpty(dir): \
|
||||||
|
dir = $$read_registry(HKLM, \
|
||||||
|
"Software\\Microsoft\\VisualStudio\\$$MSVC_VER\\Setup\\VC\\ProductDir", 32)
|
||||||
|
isEmpty(dir): \
|
||||||
|
error("Failed to find the Visual C installation directory.")
|
||||||
|
cmd += $$system_quote($$dir\\vcvarsall.bat) $$arch
|
||||||
|
}
|
||||||
|
winrt: cmd += store
|
||||||
|
|
||||||
|
isEmpty(WINSDK_VER): \
|
||||||
|
error("Mkspec does not specify WINSDK_VER. Cannot continue.")
|
||||||
|
# We prefer the environment variable, because that may work around
|
||||||
|
# a broken registry entry after uninstalling a newer SDK.
|
||||||
|
# However, we do that only if the major+minor SDK version matches
|
||||||
|
# the one requested by the mkspec, as we might be building for a
|
||||||
|
# newer target than the host.
|
||||||
|
winsdk_ver = $$(WindowsSDKVersion)
|
||||||
|
!isEmpty(winsdk_ver) {
|
||||||
|
winsdk_ver ~= s,\\\\$,, # Work around SDK breakage.
|
||||||
|
!equals(WINSDK_VER, $$replace(winsdk_ver, ^(\\d+\\.\\d+).*$, \\1)): \
|
||||||
|
winsdk_ver =
|
||||||
|
}
|
||||||
|
!isEmpty(winsdk_ver) {
|
||||||
|
cmd += $$winsdk_ver
|
||||||
|
} else {
|
||||||
|
winsdk_ver = $$read_registry(HKLM, \
|
||||||
|
"Software\\Microsoft\\Microsoft SDKs\\Windows\\v$$WINSDK_VER\\ProductVersion", 32)
|
||||||
|
isEmpty(winsdk_ver): \
|
||||||
|
error("Windows SDK $$WINSDK_VER requested by mkspec is not installed. Cannot continue.")
|
||||||
|
cmd += $${winsdk_ver}.0
|
||||||
|
}
|
||||||
|
|
||||||
|
output = $$system("$$cmd 2>&1", lines, ec)
|
||||||
|
!equals(ec, 0): \
|
||||||
|
qtToolchainError("SDK setup script failed. Output:", $$output, \
|
||||||
|
"Command was: $$cmd")
|
||||||
|
lines = $$output
|
||||||
|
for(ever) {
|
||||||
|
isEmpty(lines): \
|
||||||
|
break()
|
||||||
|
line = $$take_first(lines)
|
||||||
|
equals(line, "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="): \
|
||||||
|
break()
|
||||||
|
}
|
||||||
|
!count(lines, 3): \
|
||||||
|
qtToolchainError("SDK setup script returned unexpected output:", $$output, \
|
||||||
|
"Command was: $$cmd")
|
||||||
|
|
||||||
|
# These contain only paths for the target.
|
||||||
|
QMAKE_DEFAULT_INCDIRS = $$qtSplitPathList($$member(lines, 0))
|
||||||
|
QMAKE_DEFAULT_LIBDIRS = $$qtSplitPathList($$member(lines, 1))
|
||||||
|
# PATH is inherently for the host, and paths that are not shadowed
|
||||||
|
# by vcvarsall.bat are assumed to contain only tools that work for
|
||||||
|
# both host and target builds.
|
||||||
|
QMAKE_DEFAULT_PATH = $$qtSplitPathList($$member(lines, 2))
|
||||||
|
# We de-duplicate, because the script just prepends to the paths for
|
||||||
|
# the host, some of which are identical to the ones for the target.
|
||||||
|
QMAKE_DEFAULT_PATH = $$unique(QMAKE_DEFAULT_PATH)
|
||||||
} else: msvc {
|
} else: msvc {
|
||||||
# This doesn't differentiate between host and target,
|
|
||||||
# but neither do the compilers.
|
|
||||||
LIB = $$getenv("LIB")
|
LIB = $$getenv("LIB")
|
||||||
QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP)
|
QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP)
|
||||||
INCLUDE = $$getenv("INCLUDE")
|
INCLUDE = $$getenv("INCLUDE")
|
||||||
@ -188,101 +398,22 @@ isEmpty($${target_prefix}.INCDIRS) {
|
|||||||
cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS)
|
cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS)
|
||||||
!isEmpty(QMAKE_DEFAULT_LIBDIRS): \
|
!isEmpty(QMAKE_DEFAULT_LIBDIRS): \
|
||||||
cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS)
|
cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS)
|
||||||
|
!isEmpty(QMAKE_DEFAULT_PATH): \
|
||||||
|
cache($${target_prefix}.PATH, set stash, QMAKE_DEFAULT_PATH)
|
||||||
} else {
|
} else {
|
||||||
QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS)
|
QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS)
|
||||||
QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS)
|
QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS)
|
||||||
|
QMAKE_DEFAULT_PATH = $$eval($${target_prefix}.PATH)
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
msvc_cross {
|
||||||
# Determine and cache the compiler version
|
qmake_inc_exp.name = INCLUDE
|
||||||
#
|
qmake_inc_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_INCDIRS)
|
||||||
|
qmake_lib_exp.name = LIB
|
||||||
defineReplace(qtVariablesFromMSVC) {
|
qmake_lib_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_LIBDIRS)
|
||||||
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec)
|
qmake_path_exp.name = PATH
|
||||||
!equals(ec, 0): qtCompilerError($$1, $$ret)
|
qmake_path_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_PATH)
|
||||||
return($$ret)
|
QMAKE_EXPORTED_VARIABLES += qmake_inc_exp qmake_lib_exp qmake_path_exp
|
||||||
}
|
|
||||||
|
|
||||||
defineReplace(qtVariablesFromGCC) {
|
|
||||||
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \
|
|
||||||
2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
|
|
||||||
!equals(ec, 0): qtCompilerError($$1, $$ret)
|
|
||||||
return($$ret)
|
|
||||||
}
|
|
||||||
|
|
||||||
isEmpty($${target_prefix}.COMPILER_MACROS) {
|
|
||||||
msvc {
|
|
||||||
clang_cl {
|
|
||||||
# We need to obtain the cl.exe version first
|
|
||||||
vars = $$qtVariablesFromMSVC(cl)
|
|
||||||
for (v, vars) {
|
|
||||||
isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next()
|
|
||||||
eval($$v)
|
|
||||||
}
|
|
||||||
isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version")
|
|
||||||
|
|
||||||
QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \
|
|
||||||
"-fms-compatibility-version=\\1.\\2.\\3")
|
|
||||||
cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT)
|
|
||||||
$${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT
|
|
||||||
vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT)
|
|
||||||
} else {
|
|
||||||
vars = $$qtVariablesFromMSVC($$QMAKE_CXX)
|
|
||||||
}
|
|
||||||
} else: gcc|ghs {
|
|
||||||
vars = $$qtVariablesFromGCC($$QMAKE_CXX)
|
|
||||||
}
|
|
||||||
for (v, vars) {
|
|
||||||
!contains(v, "[A-Z_]+ = .*"): next()
|
|
||||||
# Set both <varname> for the outer scope ...
|
|
||||||
eval($$v)
|
|
||||||
v ~= s/ .*//
|
|
||||||
isEmpty($$v): error("Compiler produced empty value for $${v}.")
|
|
||||||
# ... and save QMAKE_(HOST_)?CXX.<varname> in the cache.
|
|
||||||
cache($${target_prefix}.$$v, set stash, $$v)
|
|
||||||
$${target_prefix}.COMPILER_MACROS += $$v
|
|
||||||
}
|
|
||||||
cache($${target_prefix}.COMPILER_MACROS, set stash)
|
|
||||||
} else {
|
|
||||||
# load from the cache
|
|
||||||
for (i, $${target_prefix}.COMPILER_MACROS): \
|
|
||||||
$$i = $$eval($${target_prefix}.$$i)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unset(target_prefix)
|
unset(target_prefix)
|
||||||
|
|
||||||
# Populate QMAKE_COMPILER_DEFINES and some compatibility variables.
|
|
||||||
# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal.
|
|
||||||
QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX
|
|
||||||
!isEmpty(QMAKE_MSC_VER): \
|
|
||||||
QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER
|
|
||||||
!isEmpty(QMAKE_ICC_VER): \
|
|
||||||
QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER
|
|
||||||
!isEmpty(QMAKE_APPLE_CC): \
|
|
||||||
QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC
|
|
||||||
!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \
|
|
||||||
QMAKE_COMPILER_DEFINES += __clang__ \
|
|
||||||
__clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \
|
|
||||||
__clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \
|
|
||||||
__clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION
|
|
||||||
!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \
|
|
||||||
QMAKE_COMPILER_DEFINES += __clang__ \
|
|
||||||
__clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \
|
|
||||||
__clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \
|
|
||||||
__clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION
|
|
||||||
!isEmpty(QMAKE_GCC_MAJOR_VERSION): \
|
|
||||||
QMAKE_COMPILER_DEFINES += \
|
|
||||||
__GNUC__=$$QMAKE_GCC_MAJOR_VERSION \
|
|
||||||
__GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \
|
|
||||||
__GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION
|
|
||||||
!isEmpty(QMAKE_GHS_VERSION): \
|
|
||||||
QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION
|
|
||||||
|
|
||||||
QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
|
|
||||||
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
|
|
||||||
|
|
||||||
clang_cl|intel_icl {
|
|
||||||
include(../common/msvc-based-version.conf)
|
|
||||||
} else: msvc {
|
|
||||||
include(../common/msvc-version.conf)
|
|
||||||
}
|
|
||||||
|
@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
|
|||||||
|
|
||||||
VCPROJ_ARCH = ARM
|
VCPROJ_ARCH = ARM
|
||||||
WINSDK_VER = 10.0
|
WINSDK_VER = 10.0
|
||||||
WINTARGET_VER = winv10.0
|
|
||||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||||
WINRT_MANIFEST.architecture = arm
|
WINRT_MANIFEST.architecture = arm
|
||||||
|
@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
|
|||||||
|
|
||||||
VCPROJ_ARCH = ARM
|
VCPROJ_ARCH = ARM
|
||||||
WINSDK_VER = 10.0
|
WINSDK_VER = 10.0
|
||||||
WINTARGET_VER = winv10.0
|
|
||||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||||
WINRT_MANIFEST.architecture = arm
|
WINRT_MANIFEST.architecture = arm
|
||||||
|
@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
|
|||||||
|
|
||||||
VCPROJ_ARCH = x64
|
VCPROJ_ARCH = x64
|
||||||
WINSDK_VER = 10.0
|
WINSDK_VER = 10.0
|
||||||
WINTARGET_VER = winv10.0
|
|
||||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||||
WINRT_MANIFEST.architecture = x64
|
WINRT_MANIFEST.architecture = x64
|
||||||
|
@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One
|
|||||||
|
|
||||||
VCPROJ_ARCH = x64
|
VCPROJ_ARCH = x64
|
||||||
WINSDK_VER = 10.0
|
WINSDK_VER = 10.0
|
||||||
WINTARGET_VER = winv10.0
|
|
||||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||||
WINRT_MANIFEST.architecture = x64
|
WINRT_MANIFEST.architecture = x64
|
||||||
|
@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
|
|||||||
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
||||||
VCPROJ_ARCH = Win32
|
VCPROJ_ARCH = Win32
|
||||||
WINSDK_VER = 10.0
|
WINSDK_VER = 10.0
|
||||||
WINTARGET_VER = winv10.0
|
|
||||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||||
WINRT_MANIFEST.architecture = x86
|
WINRT_MANIFEST.architecture = x86
|
||||||
|
@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
|
|||||||
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
||||||
VCPROJ_ARCH = Win32
|
VCPROJ_ARCH = Win32
|
||||||
WINSDK_VER = 10.0
|
WINSDK_VER = 10.0
|
||||||
WINTARGET_VER = winv10.0
|
|
||||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||||
WINRT_MANIFEST.architecture = x86
|
WINRT_MANIFEST.architecture = x86
|
||||||
|
@ -192,6 +192,9 @@ qmakeevaluator.o: $(QMKLIBSRC)/qmakeevaluator.cpp
|
|||||||
qmakebuiltins.o: $(QMKLIBSRC)/qmakebuiltins.cpp
|
qmakebuiltins.o: $(QMKLIBSRC)/qmakebuiltins.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
registry.o: $(QMKLIBSRC)/registry.cpp
|
||||||
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
project.o: $(QMKSRC)/project.cpp
|
project.o: $(QMKSRC)/project.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
@ -225,9 +228,6 @@ unixmake.o: $(QMKSRC)/generators/unix/unixmake.cpp
|
|||||||
unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp
|
unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
registry.o: $(QMKSRC)/generators/win32/registry.cpp
|
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
|
||||||
|
|
||||||
winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp
|
winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
@ -18,4 +18,4 @@ QTSRCS = \
|
|||||||
$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \
|
$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \
|
$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \
|
||||||
$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \
|
$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \
|
||||||
$(SOURCE_PATH)/qmake/generators/win32/registry.cpp
|
$(SOURCE_PATH)/qmake/library/registry.cpp
|
||||||
|
@ -3280,6 +3280,17 @@
|
|||||||
Returns the \c string with every special regular expression character
|
Returns the \c string with every special regular expression character
|
||||||
escaped with a backslash. This function is a wrapper around QRegExp::escape.
|
escaped with a backslash. This function is a wrapper around QRegExp::escape.
|
||||||
|
|
||||||
|
\section2 read_registry(tree, key[, flag])
|
||||||
|
|
||||||
|
Returns the value of registry key \c key inside the tree \c tree.
|
||||||
|
|
||||||
|
Only the trees \c HKEY_CURRENT_USER (\c HKCU) and \c HKEY_LOCAL_MACHINE
|
||||||
|
(\c HKLM) are supported.
|
||||||
|
|
||||||
|
The \c flag may be \c WOW64_32KEY (\c 32) or \c WOW64_64KEY (\c 64).
|
||||||
|
|
||||||
|
\note This function is available only on Windows hosts.
|
||||||
|
|
||||||
\section2 relative_path(filePath[, base])
|
\section2 relative_path(filePath[, base])
|
||||||
|
|
||||||
Returns the path to \c filePath relative to \c base.
|
Returns the path to \c filePath relative to \c base.
|
||||||
|
@ -2212,6 +2212,25 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is a more powerful alternative to the above function.
|
||||||
|
// It's meant to be internal, as one can make quite a mess with it.
|
||||||
|
void
|
||||||
|
MakefileGenerator::writeExportedVariables(QTextStream &t)
|
||||||
|
{
|
||||||
|
const auto &vars = project->values("QMAKE_EXPORTED_VARIABLES");
|
||||||
|
if (vars.isEmpty())
|
||||||
|
return;
|
||||||
|
for (const auto &exp : vars) {
|
||||||
|
const ProString &name = project->first(ProKey(exp + ".name"));
|
||||||
|
const ProString &value = project->first(ProKey(exp + ".value"));
|
||||||
|
if (!value.isEmpty())
|
||||||
|
t << name << " = " << value << endl;
|
||||||
|
else
|
||||||
|
t << name << " =\n";
|
||||||
|
}
|
||||||
|
t << endl;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
MakefileGenerator::writeDummyMakefile(QTextStream &t)
|
MakefileGenerator::writeDummyMakefile(QTextStream &t)
|
||||||
{
|
{
|
||||||
|
@ -79,6 +79,7 @@ protected:
|
|||||||
void writeHeader(QTextStream &t);
|
void writeHeader(QTextStream &t);
|
||||||
void writeSubDirs(QTextStream &t);
|
void writeSubDirs(QTextStream &t);
|
||||||
void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false);
|
void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false);
|
||||||
|
void writeExportedVariables(QTextStream &t);
|
||||||
void writeExtraVariables(QTextStream &t);
|
void writeExtraVariables(QTextStream &t);
|
||||||
void writeExtraTargets(QTextStream &t);
|
void writeExtraTargets(QTextStream &t);
|
||||||
void writeExtraCompilerTargets(QTextStream &t);
|
void writeExtraCompilerTargets(QTextStream &t);
|
||||||
|
@ -180,6 +180,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
|
|
||||||
ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES");
|
ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES");
|
||||||
|
|
||||||
|
writeExportedVariables(t);
|
||||||
|
|
||||||
t << "####### Compiler, tools and options\n\n";
|
t << "####### Compiler, tools and options\n\n";
|
||||||
t << "CC = " << var("QMAKE_CC") << endl;
|
t << "CC = " << var("QMAKE_CC") << endl;
|
||||||
t << "CXX = " << var("QMAKE_CXX") << endl;
|
t << "CXX = " << var("QMAKE_CXX") << endl;
|
||||||
|
@ -34,23 +34,10 @@
|
|||||||
#include <qdiriterator.h>
|
#include <qdiriterator.h>
|
||||||
#include <qset.h>
|
#include <qset.h>
|
||||||
|
|
||||||
#include <registry_p.h>
|
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
static QString nmakePathList(const QStringList &list)
|
|
||||||
{
|
|
||||||
QStringList pathList;
|
|
||||||
pathList.reserve(list.size());
|
|
||||||
for (const QString &path : list)
|
|
||||||
pathList.append(QDir::cleanPath(path));
|
|
||||||
|
|
||||||
return QDir::toNativeSeparators(pathList.join(QLatin1Char(';')))
|
|
||||||
.replace('#', QLatin1String("^#")).replace('$', QLatin1String("$$"));
|
|
||||||
}
|
|
||||||
|
|
||||||
NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false)
|
NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -70,194 +57,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
|
|||||||
if(Option::mkfile::do_stub_makefile)
|
if(Option::mkfile::do_stub_makefile)
|
||||||
return MakefileGenerator::writeStubMakefile(t);
|
return MakefileGenerator::writeStubMakefile(t);
|
||||||
#endif
|
#endif
|
||||||
if (!project->isHostBuild()) {
|
|
||||||
const QString msvcVer = project->first("MSVC_VER").toQString();
|
|
||||||
if (msvcVer.isEmpty()) {
|
|
||||||
fprintf(stderr, "Mkspec does not specify MSVC_VER. Cannot continue.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool winrtBuild = false;
|
|
||||||
bool crossPlatformDesktopBuild = false;
|
|
||||||
QString arch = project->first("VCPROJ_ARCH").toQString().toLower();
|
|
||||||
if (project->isActiveConfig(QStringLiteral("winrt"))) {
|
|
||||||
winrtBuild = true;
|
|
||||||
|
|
||||||
// Only add explicit support for arm64 cross-platform desktop builds.
|
|
||||||
} else if ((arch == QLatin1String("arm64")) && (msvcVer == QStringLiteral("15.0"))) {
|
|
||||||
crossPlatformDesktopBuild = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (winrtBuild || crossPlatformDesktopBuild) {
|
|
||||||
QString compiler;
|
|
||||||
QString compilerArch;
|
|
||||||
const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
|
|
||||||
if (msvcVer == QStringLiteral("15.0")) {
|
|
||||||
if (hostArch.contains("x86_64"))
|
|
||||||
compiler = QStringLiteral("HostX64/");
|
|
||||||
else
|
|
||||||
compiler = QStringLiteral("HostX86/");
|
|
||||||
if (arch == QLatin1String("arm")) {
|
|
||||||
compiler += QStringLiteral("arm");
|
|
||||||
compilerArch = QStringLiteral("arm");
|
|
||||||
} else if (arch == QLatin1String("x64")) {
|
|
||||||
compiler += QStringLiteral("x64");
|
|
||||||
compilerArch = QStringLiteral("amd64");
|
|
||||||
} else if (arch == QLatin1String("arm64")) {
|
|
||||||
compiler += QStringLiteral("arm64");
|
|
||||||
compilerArch = QStringLiteral("arm64");
|
|
||||||
} else {
|
|
||||||
arch = QStringLiteral("x86");
|
|
||||||
compiler += QStringLiteral("x86");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (arch == QLatin1String("arm")) {
|
|
||||||
compiler = QStringLiteral("x86_arm");
|
|
||||||
compilerArch = QStringLiteral("arm");
|
|
||||||
} else if (arch == QLatin1String("x64")) {
|
|
||||||
const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
|
|
||||||
if (hostArch.contains("x86_64"))
|
|
||||||
compiler = QStringLiteral("amd64");
|
|
||||||
else
|
|
||||||
compiler = QStringLiteral("x86_amd64");
|
|
||||||
compilerArch = QStringLiteral("amd64");
|
|
||||||
} else {
|
|
||||||
arch = QStringLiteral("x86");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString winsdkVer = project->first("WINSDK_VER").toQString();
|
|
||||||
if (winsdkVer.isEmpty()) {
|
|
||||||
fprintf(stderr, "Mkspec does not specify WINSDK_VER. Cannot continue.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const QString targetVer = project->first("WINTARGET_VER").toQString();
|
|
||||||
if (targetVer.isEmpty() && winrtBuild) {
|
|
||||||
fprintf(stderr, "Mkspec does not specify WINTARGET_VER. Cannot continue.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
QString regKey;
|
|
||||||
if (msvcVer == QStringLiteral("15.0"))
|
|
||||||
regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\SxS\\VS7\\") + msvcVer;
|
|
||||||
else
|
|
||||||
regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir");
|
|
||||||
const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY);
|
|
||||||
if (vcInstallDir.isEmpty()) {
|
|
||||||
fprintf(stderr, "Failed to find the Visual Studio installation directory.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString windowsPath = "Software\\Microsoft\\Microsoft SDKs\\Windows\\v";
|
|
||||||
|
|
||||||
regKey = windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder");
|
|
||||||
const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY);
|
|
||||||
if (kitDir.isEmpty()) {
|
|
||||||
fprintf(stderr, "Failed to find the Windows Kit installation directory.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
const QString vcInstallDir = "/fake/vc_install_dir";
|
|
||||||
const QString kitDir = "/fake/sdk_install_dir";
|
|
||||||
#endif // Q_OS_WIN
|
|
||||||
QStringList incDirs;
|
|
||||||
QStringList libDirs;
|
|
||||||
QStringList binDirs;
|
|
||||||
if (msvcVer == QStringLiteral("15.0")) {
|
|
||||||
const QString toolsInstallDir = qgetenv("VCToolsInstallDir");
|
|
||||||
if (toolsInstallDir.isEmpty()) {
|
|
||||||
fprintf(stderr, "Failed to access tools installation dir.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
binDirs << toolsInstallDir + QStringLiteral("bin/") + compiler;
|
|
||||||
if (arch == QStringLiteral("x64"))
|
|
||||||
binDirs << toolsInstallDir + QStringLiteral("bin/HostX86/X86");
|
|
||||||
binDirs << kitDir + QStringLiteral("bin/x86");
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("Common7/Tools");
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("Common7/ide");
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("MSBuild/15.0/bin");
|
|
||||||
|
|
||||||
incDirs << toolsInstallDir + QStringLiteral("include");
|
|
||||||
incDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/include");
|
|
||||||
|
|
||||||
const QString crtVersion = qgetenv("UCRTVersion");
|
|
||||||
if (crtVersion.isEmpty()) {
|
|
||||||
fprintf(stderr, "Failed to access CRT version.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion;
|
|
||||||
const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion;
|
|
||||||
incDirs << crtInclude + QStringLiteral("/ucrt");
|
|
||||||
incDirs << crtInclude + QStringLiteral("/um");
|
|
||||||
incDirs << crtInclude + QStringLiteral("/shared");
|
|
||||||
incDirs << crtInclude + QStringLiteral("/winrt");
|
|
||||||
|
|
||||||
if (winrtBuild) {
|
|
||||||
libDirs << toolsInstallDir + QStringLiteral("lib/") + arch + QStringLiteral("/store");
|
|
||||||
} else {
|
|
||||||
// Desktop projects may require the atl headers and libs.
|
|
||||||
incDirs << toolsInstallDir + QStringLiteral("atlmfc/include");
|
|
||||||
libDirs << toolsInstallDir + QStringLiteral("atlmfc/lib/") + compilerArch;
|
|
||||||
libDirs << toolsInstallDir + QStringLiteral("lib/") + arch;
|
|
||||||
}
|
|
||||||
|
|
||||||
libDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/lib/") + arch;
|
|
||||||
|
|
||||||
libDirs << crtLib + QStringLiteral("/ucrt/") + arch;
|
|
||||||
libDirs << crtLib + QStringLiteral("/um/") + arch;
|
|
||||||
} else if (msvcVer == QStringLiteral("14.0")) {
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("bin/") + compiler;
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("bin/"); // Maybe remove for x86 again?
|
|
||||||
binDirs << kitDir + QStringLiteral("bin/") + (arch == QStringLiteral("arm") ? QStringLiteral("x86") : arch);
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("../Common7/Tools/bin");
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("../Common7/Tools");
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("../Common7/ide");
|
|
||||||
binDirs << kitDir + QStringLiteral("Windows Performance Toolkit/");
|
|
||||||
|
|
||||||
incDirs << vcInstallDir + QStringLiteral("include");
|
|
||||||
incDirs << vcInstallDir + QStringLiteral("atlmfc/include");
|
|
||||||
|
|
||||||
const QString crtVersion = qgetenv("UCRTVersion");
|
|
||||||
if (crtVersion.isEmpty()) {
|
|
||||||
fprintf(stderr, "Failed to access CRT version.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion;
|
|
||||||
const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion;
|
|
||||||
incDirs << crtInclude + QStringLiteral("/ucrt");
|
|
||||||
incDirs << crtInclude + QStringLiteral("/um");
|
|
||||||
incDirs << crtInclude + QStringLiteral("/shared");
|
|
||||||
incDirs << crtInclude + QStringLiteral("/winrt");
|
|
||||||
|
|
||||||
libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch;
|
|
||||||
libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch;
|
|
||||||
|
|
||||||
libDirs << crtLib + QStringLiteral("/ucrt/") + arch;
|
|
||||||
libDirs << crtLib + QStringLiteral("/um/") + arch;
|
|
||||||
} else {
|
|
||||||
incDirs << vcInstallDir + QStringLiteral("/include");
|
|
||||||
libDirs << vcInstallDir + QStringLiteral("/lib/store/") + compilerArch
|
|
||||||
<< vcInstallDir + QStringLiteral("/lib/") + compilerArch;
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("/bin/") + compiler
|
|
||||||
<< vcInstallDir + QStringLiteral("/../Common7/IDE");
|
|
||||||
libDirs << kitDir + QStringLiteral("/Lib/") + targetVer + ("/um/") + arch;
|
|
||||||
incDirs << kitDir + QStringLiteral("/include/um")
|
|
||||||
<< kitDir + QStringLiteral("/include/shared")
|
|
||||||
<< kitDir + QStringLiteral("/include/winrt");
|
|
||||||
}
|
|
||||||
|
|
||||||
binDirs << vcInstallDir + QStringLiteral("/bin");
|
|
||||||
|
|
||||||
// Inherit PATH
|
|
||||||
binDirs << QString::fromLocal8Bit(qgetenv("PATH")).split(QLatin1Char(';'));
|
|
||||||
|
|
||||||
t << "\nINCLUDE = " << nmakePathList(incDirs);
|
|
||||||
t << "\nLIB = " << nmakePathList(libDirs);
|
|
||||||
t << "\nPATH = " << nmakePathList(binDirs) << '\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
writeNmakeParts(t);
|
writeNmakeParts(t);
|
||||||
return MakefileGenerator::writeMakefile(t);
|
return MakefileGenerator::writeMakefile(t);
|
||||||
}
|
}
|
||||||
|
@ -520,6 +520,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
|
|||||||
|
|
||||||
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
||||||
{
|
{
|
||||||
|
writeExportedVariables(t);
|
||||||
|
|
||||||
t << "####### Compiler, tools and options\n\n";
|
t << "####### Compiler, tools and options\n\n";
|
||||||
t << "CC = " << var("QMAKE_CC") << endl;
|
t << "CC = " << var("QMAKE_CC") << endl;
|
||||||
t << "CXX = " << var("QMAKE_CXX") << endl;
|
t << "CXX = " << var("QMAKE_CXX") << endl;
|
||||||
|
@ -52,6 +52,9 @@
|
|||||||
# include <qthreadpool.h>
|
# include <qthreadpool.h>
|
||||||
#endif
|
#endif
|
||||||
#include <qversionnumber.h>
|
#include <qversionnumber.h>
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
# include <registry_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -93,7 +96,7 @@ enum ExpandFunc {
|
|||||||
E_UPPER, E_LOWER, E_TITLE, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE,
|
E_UPPER, E_LOWER, E_TITLE, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE,
|
||||||
E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS,
|
E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS,
|
||||||
E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH,
|
E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH,
|
||||||
E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV
|
E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV, E_READ_REGISTRY
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TestFunc {
|
enum TestFunc {
|
||||||
@ -190,6 +193,7 @@ void QMakeEvaluator::initFunctionStatics()
|
|||||||
{ "system_quote", E_SYSTEM_QUOTE, -1, 1, "arg" },
|
{ "system_quote", E_SYSTEM_QUOTE, -1, 1, "arg" },
|
||||||
{ "shell_quote", E_SHELL_QUOTE, -1, 1, "arg" },
|
{ "shell_quote", E_SHELL_QUOTE, -1, 1, "arg" },
|
||||||
{ "getenv", E_GETENV, 1, 1, "arg" },
|
{ "getenv", E_GETENV, 1, 1, "arg" },
|
||||||
|
{ "read_registry", E_READ_REGISTRY, 2, 3, "tree, key, [wow64]" },
|
||||||
};
|
};
|
||||||
statics.expands.reserve((int)(sizeof(expandInits)/sizeof(expandInits[0])));
|
statics.expands.reserve((int)(sizeof(expandInits)/sizeof(expandInits[0])));
|
||||||
for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i)
|
for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i)
|
||||||
@ -1214,6 +1218,40 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
ret << ProString(m_option->getEnv(u1.str()));
|
ret << ProString(m_option->getEnv(u1.str()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
case E_READ_REGISTRY: {
|
||||||
|
HKEY tree;
|
||||||
|
const auto par = args.at(0);
|
||||||
|
if (!par.compare(QLatin1String("HKCU"), Qt::CaseInsensitive)
|
||||||
|
|| !par.compare(QLatin1String("HKEY_CURRENT_USER"), Qt::CaseInsensitive)) {
|
||||||
|
tree = HKEY_CURRENT_USER;
|
||||||
|
} else if (!par.compare(QLatin1String("HKLM"), Qt::CaseInsensitive)
|
||||||
|
|| !par.compare(QLatin1String("HKEY_LOCAL_MACHINE"), Qt::CaseInsensitive)) {
|
||||||
|
tree = HKEY_LOCAL_MACHINE;
|
||||||
|
} else {
|
||||||
|
evalError(fL1S("read_registry(): invalid or unsupported registry tree %1.")
|
||||||
|
.arg(par.toQStringView()));
|
||||||
|
goto allfail;
|
||||||
|
}
|
||||||
|
int flags = 0;
|
||||||
|
if (args.count() > 2) {
|
||||||
|
const auto opt = args.at(2);
|
||||||
|
if (opt == "32"
|
||||||
|
|| !opt.compare(QLatin1String("wow64_32key"), Qt::CaseInsensitive)) {
|
||||||
|
flags = KEY_WOW64_32KEY;
|
||||||
|
} else if (opt == "64"
|
||||||
|
|| !opt.compare(QLatin1String("wow64_64key"), Qt::CaseInsensitive)) {
|
||||||
|
flags = KEY_WOW64_64KEY;
|
||||||
|
} else {
|
||||||
|
evalError(fL1S("read_registry(): invalid option %1.")
|
||||||
|
.arg(opt.toQStringView()));
|
||||||
|
goto allfail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret << ProString(qt_readRegistryKey(tree, args.at(1).toQString(m_tmp1), flags));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
evalError(fL1S("Function '%1' is not implemented.").arg(func.toQStringView()));
|
evalError(fL1S("Function '%1' is not implemented.").arg(func.toQStringView()));
|
||||||
break;
|
break;
|
||||||
|
@ -17,7 +17,7 @@ repositories {
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -204,9 +204,9 @@ template <typename T> inline Q_DECL_CONSTEXPR T qToBigEndian(T source)
|
|||||||
template <typename T> inline Q_DECL_CONSTEXPR T qFromBigEndian(T source)
|
template <typename T> inline Q_DECL_CONSTEXPR T qFromBigEndian(T source)
|
||||||
{ return source; }
|
{ return source; }
|
||||||
template <typename T> inline Q_DECL_CONSTEXPR T qToLittleEndian(T source)
|
template <typename T> inline Q_DECL_CONSTEXPR T qToLittleEndian(T source)
|
||||||
{ return qbswap<T>(source); }
|
{ return qbswap(source); }
|
||||||
template <typename T> inline Q_DECL_CONSTEXPR T qFromLittleEndian(T source)
|
template <typename T> inline Q_DECL_CONSTEXPR T qFromLittleEndian(T source)
|
||||||
{ return qbswap<T>(source); }
|
{ return qbswap(source); }
|
||||||
template <typename T> inline void qToBigEndian(T src, void *dest)
|
template <typename T> inline void qToBigEndian(T src, void *dest)
|
||||||
{ qToUnaligned<T>(src, dest); }
|
{ qToUnaligned<T>(src, dest); }
|
||||||
template <typename T> inline void qToLittleEndian(T src, void *dest)
|
template <typename T> inline void qToLittleEndian(T src, void *dest)
|
||||||
|
@ -170,8 +170,11 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool)
|
|||||||
bool qt_mac_applicationIsInDarkMode()
|
bool qt_mac_applicationIsInDarkMode()
|
||||||
{
|
{
|
||||||
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
|
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
|
||||||
if (__builtin_available(macOS 10.14, *))
|
if (__builtin_available(macOS 10.14, *)) {
|
||||||
return [NSApp.effectiveAppearance.name hasSuffix:@"DarkAqua"];
|
auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
|
||||||
|
@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
|
||||||
|
return [appearance isEqualToString:NSAppearanceNameDarkAqua];
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2323,6 +2323,8 @@ void *QMetaType::createExtended(const void *copy) const
|
|||||||
*/
|
*/
|
||||||
void QMetaType::destroyExtended(void *data) const
|
void QMetaType::destroyExtended(void *data) const
|
||||||
{
|
{
|
||||||
|
if (m_typeId == QMetaType::UnknownType)
|
||||||
|
return;
|
||||||
if (Q_UNLIKELY(m_typedDestructor && !m_destructor))
|
if (Q_UNLIKELY(m_typedDestructor && !m_destructor))
|
||||||
m_typedDestructor(m_typeId, data);
|
m_typedDestructor(m_typeId, data);
|
||||||
else
|
else
|
||||||
@ -2339,6 +2341,8 @@ void QMetaType::destroyExtended(void *data) const
|
|||||||
*/
|
*/
|
||||||
void *QMetaType::constructExtended(void *where, const void *copy) const
|
void *QMetaType::constructExtended(void *where, const void *copy) const
|
||||||
{
|
{
|
||||||
|
if (m_typeId == QMetaType::UnknownType)
|
||||||
|
return nullptr;
|
||||||
if (m_typedConstructor && !m_constructor)
|
if (m_typedConstructor && !m_constructor)
|
||||||
return m_typedConstructor(m_typeId, where, copy);
|
return m_typedConstructor(m_typeId, where, copy);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -2353,6 +2357,8 @@ void *QMetaType::constructExtended(void *where, const void *copy) const
|
|||||||
*/
|
*/
|
||||||
void QMetaType::destructExtended(void *data) const
|
void QMetaType::destructExtended(void *data) const
|
||||||
{
|
{
|
||||||
|
if (m_typeId == QMetaType::UnknownType)
|
||||||
|
return;
|
||||||
if (m_typedDestructor && !m_destructor)
|
if (m_typedDestructor && !m_destructor)
|
||||||
m_typedDestructor(m_typeId, data);
|
m_typedDestructor(m_typeId, data);
|
||||||
}
|
}
|
||||||
|
@ -370,6 +370,7 @@ void QDtlsBasePrivate::setConfiguration(const QSslConfiguration &configuration)
|
|||||||
dtlsConfiguration.nextProtocolNegotiationStatus = configuration.nextProtocolNegotiationStatus();
|
dtlsConfiguration.nextProtocolNegotiationStatus = configuration.nextProtocolNegotiationStatus();
|
||||||
dtlsConfiguration.dtlsCookieEnabled = configuration.dtlsCookieVerificationEnabled();
|
dtlsConfiguration.dtlsCookieEnabled = configuration.dtlsCookieVerificationEnabled();
|
||||||
dtlsConfiguration.allowRootCertOnDemandLoading = configuration.d->allowRootCertOnDemandLoading;
|
dtlsConfiguration.allowRootCertOnDemandLoading = configuration.d->allowRootCertOnDemandLoading;
|
||||||
|
dtlsConfiguration.backendConfig = configuration.backendConfiguration();
|
||||||
|
|
||||||
clearDtlsError();
|
clearDtlsError();
|
||||||
}
|
}
|
||||||
|
@ -124,6 +124,7 @@ private slots:
|
|||||||
void compareCustomType();
|
void compareCustomType();
|
||||||
void compareCustomEqualOnlyType();
|
void compareCustomEqualOnlyType();
|
||||||
void customDebugStream();
|
void customDebugStream();
|
||||||
|
void unknownType();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BaseGenericType
|
struct BaseGenericType
|
||||||
@ -2541,6 +2542,16 @@ void tst_QMetaType::customDebugStream()
|
|||||||
qDebug() << v1;
|
qDebug() << v1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QMetaType::unknownType()
|
||||||
|
{
|
||||||
|
QMetaType invalid(QMetaType::UnknownType);
|
||||||
|
QVERIFY(!invalid.create());
|
||||||
|
QVERIFY(!invalid.sizeOf());
|
||||||
|
QVERIFY(!invalid.metaObject());
|
||||||
|
int buffer = 0xBAD;
|
||||||
|
invalid.construct(&buffer);
|
||||||
|
QCOMPARE(buffer, 0xBAD);
|
||||||
|
}
|
||||||
// Compile-time test, it should be possible to register function pointer types
|
// Compile-time test, it should be possible to register function pointer types
|
||||||
class Undefined;
|
class Undefined;
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
[remainingTime]
|
[remainingTime]
|
||||||
windows
|
windows
|
||||||
osx
|
osx
|
||||||
[basic_chrono]
|
|
||||||
osx ci
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
CONFIG += testcase
|
CONFIG += testcase
|
||||||
TARGET = tst_qmakelib
|
TARGET = tst_qmakelib
|
||||||
QT = core testlib
|
QT = core testlib
|
||||||
|
win32: LIBS += -ladvapi32
|
||||||
|
|
||||||
INCLUDEPATH += ../../../../qmake/library
|
INCLUDEPATH += ../../../../qmake/library
|
||||||
VPATH += ../../../../qmake/library
|
VPATH += ../../../../qmake/library
|
||||||
@ -13,6 +14,7 @@ SOURCES += \
|
|||||||
parsertest.cpp \
|
parsertest.cpp \
|
||||||
evaltest.cpp \
|
evaltest.cpp \
|
||||||
ioutils.cpp \
|
ioutils.cpp \
|
||||||
|
registry.cpp \
|
||||||
proitems.cpp \
|
proitems.cpp \
|
||||||
qmakevfs.cpp \
|
qmakevfs.cpp \
|
||||||
qmakeparser.cpp \
|
qmakeparser.cpp \
|
||||||
|
@ -38,49 +38,6 @@
|
|||||||
#include <qpa/qplatformtheme.h>
|
#include <qpa/qplatformtheme.h>
|
||||||
#include <private/qguiapplication_p.h>
|
#include <private/qguiapplication_p.h>
|
||||||
|
|
||||||
#define CONVENIENCE_FUNC_SYMS(func) \
|
|
||||||
{ \
|
|
||||||
int x1 = QMessageBox::func(0, "Foo", "Bar"); \
|
|
||||||
int x3 = QMessageBox::func(0, "Foo", "Bar", "Save"); \
|
|
||||||
int x6 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As"); \
|
|
||||||
int x7 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save"); \
|
|
||||||
int x8 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save", 1); \
|
|
||||||
int x9 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save", 1, 2); \
|
|
||||||
int x10 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::YesAll, QMessageBox::Yes); \
|
|
||||||
int x11 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::YesAll, QMessageBox::Yes, \
|
|
||||||
QMessageBox::No); \
|
|
||||||
qDebug("%d %d %d %d %d %d %d %d", x1, x3, x6, x7, x8, x9, x10, x11); \
|
|
||||||
{ \
|
|
||||||
int x4 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No); \
|
|
||||||
int x5 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No); \
|
|
||||||
int x6 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No); \
|
|
||||||
int x7 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No); \
|
|
||||||
int x8 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No); \
|
|
||||||
int x9 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); \
|
|
||||||
int x10 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No, (int)QMessageBox::Ok); \
|
|
||||||
int x11 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No, (int)QMessageBox::Ok); \
|
|
||||||
int x12 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No, (int)QMessageBox::Ok); \
|
|
||||||
int x13 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No, (int)QMessageBox::Ok); \
|
|
||||||
int x14 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No, (int)QMessageBox::Ok); \
|
|
||||||
int x15 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, (int)QMessageBox::Ok); \
|
|
||||||
int x16 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No, QMessageBox::Ok); \
|
|
||||||
int x17 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No, QMessageBox::Ok); \
|
|
||||||
int x18 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No, QMessageBox::Ok); \
|
|
||||||
int x19 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No, QMessageBox::Ok); \
|
|
||||||
int x20 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No, QMessageBox::Ok); \
|
|
||||||
int x21 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Ok); \
|
|
||||||
qDebug("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CONVENIENCE_FUNC_SYMS_EXTRA(func) \
|
|
||||||
{ \
|
|
||||||
int x1 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes); \
|
|
||||||
int x2 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes); \
|
|
||||||
int x3 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default); \
|
|
||||||
qDebug("%d %d %d", x1, x2, x3); \
|
|
||||||
}
|
|
||||||
|
|
||||||
class tst_QMessageBox : public QObject
|
class tst_QMessageBox : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -103,7 +60,6 @@ private slots:
|
|||||||
void staticSourceCompat();
|
void staticSourceCompat();
|
||||||
void instanceSourceCompat();
|
void instanceSourceCompat();
|
||||||
|
|
||||||
void testSymbols();
|
|
||||||
void incorrectDefaultButton();
|
void incorrectDefaultButton();
|
||||||
void updateSize();
|
void updateSize();
|
||||||
|
|
||||||
@ -509,96 +465,6 @@ void tst_QMessageBox::instanceSourceCompat()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QMessageBox::testSymbols()
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
|
|
||||||
QMessageBox::Icon icon;
|
|
||||||
icon = QMessageBox::NoIcon;
|
|
||||||
icon = QMessageBox::Information;
|
|
||||||
icon = QMessageBox::Warning;
|
|
||||||
icon = QMessageBox::Critical;
|
|
||||||
icon = QMessageBox::Question;
|
|
||||||
|
|
||||||
QMessageBox mb1;
|
|
||||||
QMessageBox mb2(0);
|
|
||||||
QMessageBox mb3(&mb1);
|
|
||||||
QMessageBox mb3b("title", "text", QMessageBox::Critical, int(QMessageBox::Yes),
|
|
||||||
int(QMessageBox::No), int(QMessageBox::Cancel), &mb1, Qt::Dialog);
|
|
||||||
|
|
||||||
QMessageBox::Button button = QMessageBox::NoButton;
|
|
||||||
button = QMessageBox::Ok;
|
|
||||||
button = QMessageBox::Cancel;
|
|
||||||
button = QMessageBox::Yes;
|
|
||||||
button = QMessageBox::No;
|
|
||||||
button = QMessageBox::Abort;
|
|
||||||
button = QMessageBox::Retry;
|
|
||||||
button = QMessageBox::Ignore;
|
|
||||||
button = QMessageBox::YesAll;
|
|
||||||
button = QMessageBox::NoAll;
|
|
||||||
button = QMessageBox::ButtonMask;
|
|
||||||
button = QMessageBox::Default;
|
|
||||||
button = QMessageBox::Escape;
|
|
||||||
button = QMessageBox::FlagMask;
|
|
||||||
QVERIFY(button);
|
|
||||||
|
|
||||||
const QString text = QStringLiteral("Foo");
|
|
||||||
mb1.setText(text);
|
|
||||||
QCOMPARE(mb1.text(), text);
|
|
||||||
|
|
||||||
icon = mb1.icon();
|
|
||||||
QCOMPARE(icon, QMessageBox::NoIcon);
|
|
||||||
mb1.setIcon(QMessageBox::Question);
|
|
||||||
QCOMPARE(mb1.icon(), QMessageBox::Question);
|
|
||||||
|
|
||||||
QPixmap iconPixmap = mb1.iconPixmap();
|
|
||||||
mb1.setIconPixmap(iconPixmap);
|
|
||||||
QCOMPARE(mb1.icon(), QMessageBox::NoIcon);
|
|
||||||
|
|
||||||
QCOMPARE(mb1.buttonText(QMessageBox::Ok), QLatin1String("OK"));
|
|
||||||
QCOMPARE(mb1.buttonText(QMessageBox::Cancel), QString());
|
|
||||||
QCOMPARE(mb1.buttonText(QMessageBox::Ok | QMessageBox::Default), QString());
|
|
||||||
|
|
||||||
const QString button1 = QStringLiteral("Bar");
|
|
||||||
mb2.setButtonText(QMessageBox::Cancel, QStringLiteral("Foo"));
|
|
||||||
mb2.setButtonText(QMessageBox::Ok, button1);
|
|
||||||
mb2.setButtonText(QMessageBox::Ok | QMessageBox::Default, QStringLiteral("Baz"));
|
|
||||||
|
|
||||||
QCOMPARE(mb2.buttonText(QMessageBox::Cancel), QString());
|
|
||||||
QCOMPARE(mb2.buttonText(QMessageBox::Ok), button1);
|
|
||||||
|
|
||||||
QVERIFY(mb3b.buttonText(QMessageBox::Yes).endsWith("Yes"));
|
|
||||||
QCOMPARE(mb3b.buttonText(QMessageBox::YesAll), QString());
|
|
||||||
QCOMPARE(mb3b.buttonText(QMessageBox::Ok), QString());
|
|
||||||
|
|
||||||
const QString button2 = QStringLiteral("Blah");
|
|
||||||
mb3b.setButtonText(QMessageBox::Yes, button2);
|
|
||||||
mb3b.setButtonText(QMessageBox::YesAll, QStringLiteral("Zoo"));
|
|
||||||
mb3b.setButtonText(QMessageBox::Ok, QStringLiteral("Zoo"));
|
|
||||||
|
|
||||||
QCOMPARE(mb3b.buttonText(QMessageBox::Yes), button2);
|
|
||||||
QCOMPARE(mb3b.buttonText(QMessageBox::YesAll), QString());
|
|
||||||
QCOMPARE(mb3b.buttonText(QMessageBox::Ok), QString());
|
|
||||||
|
|
||||||
QCOMPARE(mb1.textFormat(), Qt::AutoText);
|
|
||||||
mb1.setTextFormat(Qt::PlainText);
|
|
||||||
QCOMPARE(mb1.textFormat(), Qt::PlainText);
|
|
||||||
|
|
||||||
CONVENIENCE_FUNC_SYMS(information);
|
|
||||||
CONVENIENCE_FUNC_SYMS_EXTRA(information);
|
|
||||||
CONVENIENCE_FUNC_SYMS(question);
|
|
||||||
CONVENIENCE_FUNC_SYMS_EXTRA(question);
|
|
||||||
CONVENIENCE_FUNC_SYMS(warning);
|
|
||||||
CONVENIENCE_FUNC_SYMS(critical);
|
|
||||||
|
|
||||||
QSize sizeHint = mb1.sizeHint();
|
|
||||||
QVERIFY(sizeHint.width() > 20 && sizeHint.height() > 20);
|
|
||||||
|
|
||||||
QMessageBox::about(&mb1, "title", "text");
|
|
||||||
QMessageBox::aboutQt(&mb1);
|
|
||||||
QMessageBox::aboutQt(&mb1, "title");
|
|
||||||
}
|
|
||||||
|
|
||||||
void tst_QMessageBox::detailsText()
|
void tst_QMessageBox::detailsText()
|
||||||
{
|
{
|
||||||
QMessageBox box;
|
QMessageBox box;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user