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 = $$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 =
|
!versionAtLeast(CMAKE_VERSION, 2.8.3) {
|
||||||
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) {
|
|
||||||
message("cmake $$CMAKE_VERSION is too old for this test.")
|
message("cmake $$CMAKE_VERSION is too old for this test.")
|
||||||
return()
|
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)
|
# -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++)
|
# -Wvla: use of variable-length arrays (an extension to C++)
|
||||||
clang {
|
clang {
|
||||||
# Clang 3.5 introduced -Wdate-time
|
clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||||
# The conditional assumes we aren't compiling against Clang 2.x anymore
|
versionAtLeast(clang_ver, 3.5): \
|
||||||
greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 4): \
|
|
||||||
QMAKE_CXXFLAGS_WARN_ON += -Wdate-time
|
QMAKE_CXXFLAGS_WARN_ON += -Wdate-time
|
||||||
} else: gcc:!intel_icc {
|
} else: gcc:!intel_icc {
|
||||||
QMAKE_CXXFLAGS_WARN_ON += -Wvla
|
QMAKE_CXXFLAGS_WARN_ON += -Wvla
|
||||||
|
@ -195,7 +195,7 @@ sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:qtConfig(
|
|||||||
clang {
|
clang {
|
||||||
apple_clang_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
apple_clang_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||||
reg_clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_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
|
CONFIG += compiler_supports_fpmath
|
||||||
} else: gcc {
|
} else: gcc {
|
||||||
CONFIG += compiler_supports_fpmath
|
CONFIG += compiler_supports_fpmath
|
||||||
|
@ -214,20 +214,15 @@ headersclean:!internal_module {
|
|||||||
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
|
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
|
||||||
hcleanFLAGS += -Wcast-align
|
hcleanFLAGS += -Wcast-align
|
||||||
|
|
||||||
greaterThan(QT_CLANG_MAJOR_VERSION, 3) {
|
clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||||
hcleanFLAGS += -Wdouble-promotion
|
versionAtLeast(clang_ver, 3.8): hcleanFLAGS += -Wdouble-promotion
|
||||||
} greaterThan(QT_CLANG_MAJOR_VERSION, 2):greaterThan(QT_CLANG_MINOR_VERSION, 7) {
|
|
||||||
hcleanFLAGS += -Wdouble-promotion
|
|
||||||
}
|
|
||||||
|
|
||||||
!clang {
|
!clang {
|
||||||
# options accepted only by GCC
|
# options accepted only by GCC
|
||||||
|
|
||||||
greaterThan(QT_GCC_MAJOR_VERSION, 4) {
|
gcc_ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
|
||||||
hcleanFLAGS += -Wdouble-promotion
|
versionAtLeast(gcc_ver, 4.5): hcleanFLAGS += -Wdouble-promotion
|
||||||
} greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 4) {
|
|
||||||
hcleanFLAGS += -Wdouble-promotion
|
|
||||||
}
|
|
||||||
c++11 {
|
c++11 {
|
||||||
# only enabled for actual c++11 builds due to
|
# only enabled for actual c++11 builds due to
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52806
|
# 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")
|
warning("You need to update Xcode to version 7 or newer to support bitcode")
|
||||||
} else: !macx-xcode {
|
} else: !macx-xcode {
|
||||||
# Simulator builds and all debug builds SHOULD use -fembed-bitcode-marker,
|
# 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_launch_images.files = $$qmake_copy_image.output
|
||||||
QMAKE_BUNDLE_DATA += qmake_launch_images
|
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+")
|
warning("You need to update Xcode to version 6 or newer to fully support iPhone6/6+")
|
||||||
} else {
|
} else {
|
||||||
# Set up default LaunchScreen to support iPhone6/6+
|
# Set up default LaunchScreen to support iPhone6/6+
|
||||||
|
@ -21,8 +21,8 @@ unset(sim_and_dev)
|
|||||||
load(default_pre)
|
load(default_pre)
|
||||||
|
|
||||||
# Check for supported Xcode versions
|
# 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")
|
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
|
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user