-
Alexandru Croitor authored
This reverts commit c8851dd1 , and allows building on OS X 10.9 with OS X 10.10 SDK. Change-Id: Id59b08424165272fd0d35418eef45a03fce731fb Reviewed-by:
Kai Koehne <kai.koehne@qt.io>
6e9779ac
defineTest(isQtMinimum) {
!equals(QT_MAJOR_VERSION, $$1): return(false)
count(ARGS, 1, greaterThan) {
lessThan(QT_MINOR_VERSION, $$2): return(false)
}
return(true)
}
!isQtMinimum(5, 8) {
defineTest(qtConfig) {
contains(QT_CONFIG, $$1): return(true)
return(false)
}
}
defineTest(isPlatformSupported) {
QT_FOR_CONFIG += gui-private
linux {
!gcc:!clang {
skipBuild("Qt WebEngine on Linux requires clang or GCC.")
return(false)
}
gcc:!clang:!isGCCVersionSupported(): return(false)
} else:win32 {
winrt {
skipBuild("WinRT is not supported.")
return(false)
}
msvc {
!equals(MSVC_VER, "14.0") {
skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.")
return(false)
}
} else {
skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.")
return(false)
}
isBuildingOnWin32() {
skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
}
!isMinWinSDKVersion(10, 10586): {
skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.10586 or newer.")
return(false)
}
} else:osx {
lessThan(QMAKE_XCODE_VERSION, 5.1) {
skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
return(false)
}
# We require OS X 10.9 (darwin version 13.0.0) or newer
darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
lessThan(darwin_major_version, 13) {
skipBuild("Qt WebEngine requires OS X version 10.9 or newer.")
return(false)
}
!isMinOSXSDKVersion(10, 10): {
skipBuild("Qt WebEngine requires an OS X SDK version of 10.10 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
return(false)
}
} else {
skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and OS X.")
return(false)
}
!contains(QT_CONFIG, c++11) {
skipBuild("C++11 support is required in order to build chromium.")
return(false)
}
qtConfig(mirclient) {
skipBuild("Mir is not yet supported as graphics backend for Qt WebEngine.")
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
return(false)
}
static {
skipBuild("Static builds of QtWebEngine aren't supported.")
return(false)
}
!isPythonVersionSupported(): return(false)
return(true)
}
defineTest(isPythonVersionSupported) {
python_error_msg = "Python version 2 (2.7.5 or later) is required to build Qt WebEngine."
python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"')
python_version ~= s/[()]//g
python_version = $$split(python_version, ',')
python_major_version = $$first(python_version)
greaterThan(python_major_version, 2) {
skipBuild("Python version 3 is not supported by Chromium.")
skipBuild($$python_error_msg)
return(false)
}
python_minor_version = $$member(python_version, 1)
python_patch_version = $$member(python_version, 2)
greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true)
skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.")
skipBuild($$python_error_msg)
return(false)
}
defineTest(isGCCVersionSupported) {
# The below will work for gcc 4.7 and up and also match gcc 5
greaterThan(QT_GCC_MINOR_VERSION, 6):return(true)
greaterThan(QT_GCC_MAJOR_VERSION, 4):return(true)
skipBuild("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.7 is required to build Qt WebEngine.")
return(false)
}
defineTest(isQMLTestSupportApiEnabled) {
qtConfig(private_tests): return(true) # enable for developer-build
contains(QT_BUILD_PARTS, tests): return(true)
contains(WEBENGINE_CONFIG, testsupport): return(true)
return(false)
}
defineTest(isBuildingOnWin32) {
# The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
# architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
# is building for, not the system's actual architecture.
PROGRAM_FILES_X86 = $$(ProgramW6432)
isEmpty(PROGRAM_FILES_X86): return(true)
return(false)
}
defineTest(isMinOSXSDKVersion) {
requested_major = $$1
requested_minor = $$2
requested_patch = $$3
isEmpty(requested_patch): requested_patch = 0
WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.")
return(false)
}
major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0)
minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1)
patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2)
isEmpty(patch_version): patch_version = 0
greaterThan(major_version, $$requested_major):return(true)
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
return(false)
}
defineTest(isMinWinSDKVersion) {
requested_major = $$1
requested_minor = $$2
WIN_SDK_VERSION = $$(WindowsSDKVersion)
# major.0.minor
major_version = $$section(WIN_SDK_VERSION, ., 0, 0)
minor_version = $$section(WIN_SDK_VERSION, ., 2, 2)
greaterThan(major_version, $$requested_major):return(true)
equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
equals(major_version, $$requested_major):equals(minor_version, $$requested_minor)::return(true)
return(false)
}
# Map to the correct target type for gyp
defineReplace(toGypTargetType) {
equals(TEMPLATE, "app"):return("executable")
equals(TEMPLATE, "lib") {
CONFIG(static): return("static_library")
return("shared_library")
}
return("none")
}
defineReplace(getConfigDir) {
win32:contains(QMAKE_TARGET.arch, x86_64) {
CONFIG(release, debug|release):return("Release_x64")
return("Debug_x64")
}
CONFIG(release, debug|release):return("Release")
return("Debug")
}
defineReplace(getChromiumSrcDir) {
git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir")
# Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used)
isEmpty(git_chromium_src_dir): git_chromium_src_dir = "src/3rdparty/chromium"
return($$git_chromium_src_dir)
}
defineReplace(extractCFlag) {
CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS
OPTION = $$find(CFLAGS, $$1)
OPTION = $$split(OPTION, =)
return ($$member(OPTION, 1))
}
defineReplace(findMocables) {
mocables = $$system("$$system_path(python $$QTWEBENGINE_ROOT/tools/buildscripts/find-mocables $$_PRO_FILE_PWD_ $$1)")
mocables = $$replace(mocables, $$re_escape($$system_path($${_PRO_FILE_PWD_}/)), '')
return($$mocables)
}
defineReplace(findIncludedMocFiles) {
return($$system("$$system_path(python $$QTWEBENGINE_ROOT/tools/buildscripts/find-included-moc-files $$_PRO_FILE_PWD_ $$1)"))
}
defineReplace(mocOutput) {
out = $$1
# The order is important, since the output of the second replace would end up accidentaly transformed by the first one
for(ext, $$list($${QMAKE_EXT_CPP})): \
211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
out = $$replace(out, ^(.*)($$re_escape($${ext})), $${QMAKE_CPP_MOD_MOC}\\1$${QMAKE_EXT_CPP_MOC})
for(ext, $$list($${QMAKE_EXT_H})): \
out = $$replace(out, ^(.*)($$re_escape($${ext})), $${QMAKE_H_MOD_MOC}\\1$${first(QMAKE_EXT_CPP)})
return($$out)
}
defineReplace(rccOutput) {
out = $$1
out = $$replace(out, .qrc, .cpp)
out = $$join(out, qrc_, qrc_)
return($$out)
}
defineReplace(rccExternFunc) {
out = $$1
out = $$replace(out, .qrc, )
return($$out)
}
defineReplace(which) {
out = $$1
win32 {
command = $$split(out, " ")
executable = $$first(command)
# Return the first match only
out = $$system("((for /f \"usebackq delims=\" %i in (`where $$executable 2^> NUL`) do @if not defined _endwhich (@echo %i & set _endwhich=true)) & set _endwhich=)")
isEmpty(out) {
message($$executable not found)
out = $$executable
}
for(arg, command): !equals(arg, $$executable): out += $$arg
} else:unix {
command = $$split(out, " ")
executable = $$first(command)
out = $$system("which $$executable 2>/dev/null")
isEmpty(out) {
message($$executable not found)
out = $$executable
}
for(arg, command): !equals(arg, $$executable): out += $$arg
}
return($$out)
}
defineTest(use?) {
contains(WEBENGINE_CONFIG, use_$$lower($$1)): return(true)
return(false)
}
defineReplace(findOrBuildNinja) {
# If NINJA_PATH env var is set, prefer that.
# Fallback to locating our own bootstrapped ninja.
out = $(NINJA_PATH)
!exists($$out) {
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
out = $$shadowed($$absolute_path("ninja/ninja", "$$src_3rd_party_dir"))
win32: out = $${out}.exe
out = $$system_path($$out)
# If we did not find ninja, then we bootstrap it.
!exists($$out) {
# If we are making a shadow build, copy the ninja sources to the build directory.
!equals(PWD, $${OUT_PWD}) {
log("Build directory is different from source directory - copying ninja sources to the build tree...")
shadow_3rd_party_path = $$system_path($$shadowed($$src_3rd_party_dir))
!exists($$dirname(out)): mkpath($$dirname(out))
copy_dir_files {
system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$dirname(out))")
281282283284285286287288289290291292293294295
} else {
system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$shadow_3rd_party_path)")
}
}
system("cd $$system_quote($$dirname(out)) && python configure.py --bootstrap")
}
}
return($$out)
}
defineTest(skipBuild) {
skipBuildReason = "$$skipBuildReason $${EOL}$$1"
export(skipBuildReason)
}