Compare versions in qmake files with versionAtLeast
Change-Id: Iba5686131d9f3e22e9a4d6da473a61a845b0418e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
6b38758084
commit
bf6ae8406b
@ -27,22 +27,8 @@ isEmpty(CTEST_VERSION) {
|
||||
}
|
||||
|
||||
CMAKE_VERSION = $$last(CMAKE_VERSION)
|
||||
CMAKE_VERSION_MAJOR = $$section(CMAKE_VERSION, ., 0, 0)
|
||||
CMAKE_VERSION_MINOR = $$section(CMAKE_VERSION, ., 1, 1)
|
||||
CMAKE_VERSION_PATCH = $$section(CMAKE_VERSION, ., 2, 2)
|
||||
# CMake can report versions like 2.8.11-rc1, so strip off the rc part.
|
||||
CMAKE_VERSION_PATCH ~= s,-.*,,
|
||||
|
||||
VERSION_OK =
|
||||
greaterThan(CMAKE_VERSION_MAJOR, 2) {
|
||||
VERSION_OK = 1
|
||||
} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 8) {
|
||||
VERSION_OK = 1
|
||||
} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 7):greaterThan(CMAKE_VERSION_PATCH, 2) {
|
||||
VERSION_OK = 1
|
||||
}
|
||||
|
||||
isEmpty(VERSION_OK) {
|
||||
!versionAtLeast(CMAKE_VERSION, 2.8.3) {
|
||||
message("cmake $$CMAKE_VERSION is too old for this test.")
|
||||
return()
|
||||
}
|
||||
|
@ -55,9 +55,8 @@ host_build:cross_compile: return()
|
||||
# -Wdate-time: warn if we use __DATE__ or __TIME__ (we want to be able to reproduce the exact same binary)
|
||||
# -Wvla: use of variable-length arrays (an extension to C++)
|
||||
clang {
|
||||
# Clang 3.5 introduced -Wdate-time
|
||||
# The conditional assumes we aren't compiling against Clang 2.x anymore
|
||||
greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 4): \
|
||||
clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
versionAtLeast(clang_ver, 3.5): \
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wdate-time
|
||||
} else: gcc:!intel_icc {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wvla
|
||||
|
@ -195,7 +195,7 @@ sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:qtConfig(
|
||||
clang {
|
||||
apple_clang_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||
reg_clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
!lessThan(apple_clang_ver, "5.1")|!lessThan(reg_clang_ver, "3.4"): \
|
||||
versionAtLeast(apple_clang_ver, 5.1)|versionAtLeast(reg_clang_ver, 3.4): \
|
||||
CONFIG += compiler_supports_fpmath
|
||||
} else: gcc {
|
||||
CONFIG += compiler_supports_fpmath
|
||||
|
@ -214,20 +214,15 @@ headersclean:!internal_module {
|
||||
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
|
||||
hcleanFLAGS += -Wcast-align
|
||||
|
||||
greaterThan(QT_CLANG_MAJOR_VERSION, 3) {
|
||||
hcleanFLAGS += -Wdouble-promotion
|
||||
} greaterThan(QT_CLANG_MAJOR_VERSION, 2):greaterThan(QT_CLANG_MINOR_VERSION, 7) {
|
||||
hcleanFLAGS += -Wdouble-promotion
|
||||
}
|
||||
clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
versionAtLeast(clang_ver, 3.8): hcleanFLAGS += -Wdouble-promotion
|
||||
|
||||
!clang {
|
||||
# options accepted only by GCC
|
||||
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 4) {
|
||||
hcleanFLAGS += -Wdouble-promotion
|
||||
} greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 4) {
|
||||
hcleanFLAGS += -Wdouble-promotion
|
||||
}
|
||||
gcc_ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
|
||||
versionAtLeast(gcc_ver, 4.5): hcleanFLAGS += -Wdouble-promotion
|
||||
|
||||
c++11 {
|
||||
# only enabled for actual c++11 builds due to
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52806
|
||||
|
@ -1,4 +1,4 @@
|
||||
lessThan(QMAKE_XCODE_VERSION, "7.0") {
|
||||
!versionAtLeast(QMAKE_XCODE_VERSION, 7.0) {
|
||||
warning("You need to update Xcode to version 7 or newer to support bitcode")
|
||||
} else: !macx-xcode {
|
||||
# Simulator builds and all debug builds SHOULD use -fembed-bitcode-marker,
|
||||
|
@ -39,7 +39,7 @@ macx-xcode {
|
||||
qmake_launch_images.files = $$qmake_copy_image.output
|
||||
QMAKE_BUNDLE_DATA += qmake_launch_images
|
||||
|
||||
lessThan(QMAKE_XCODE_VERSION, "6.0") {
|
||||
!versionAtLeast(QMAKE_XCODE_VERSION, 6.0) {
|
||||
warning("You need to update Xcode to version 6 or newer to fully support iPhone6/6+")
|
||||
} else {
|
||||
# Set up default LaunchScreen to support iPhone6/6+
|
||||
|
@ -21,8 +21,8 @@ unset(sim_and_dev)
|
||||
load(default_pre)
|
||||
|
||||
# Check for supported Xcode versions
|
||||
lessThan(QMAKE_XCODE_VERSION, "4.3"): \
|
||||
!versionAtLeast(QMAKE_XCODE_VERSION, 4.3): \
|
||||
error("This mkspec requires Xcode 4.3 or later")
|
||||
|
||||
ios:shared:lessThan(QMAKE_IOS_DEPLOYMENT_TARGET, "8.0"): \
|
||||
ios:shared:!versionAtLeast(QMAKE_IOS_DEPLOYMENT_TARGET, 8.0): \
|
||||
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
|
||||
|
Loading…
Reference in New Issue
Block a user