summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-02-01 20:50:41 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-02-01 20:58:12 +0100
commitb5d7ec9226eee41d9c3516bf51dc48c283e8b13e (patch)
tree994d2f09fd2106efed07e007becffed6e56a584c /tools
parent3c4c080e46a8fa229d7e1fdaee82f750b3558aa0 (diff)
parent2313a580c0e3f0636a12697ba4b872bfdccbcf7f (diff)
Merge dev into 5.9
Diffstat (limited to 'tools')
-rw-r--r--tools/qmake/mkspecs/features/configure.prf12
-rw-r--r--tools/qmake/mkspecs/features/functions.prf21
-rw-r--r--tools/qmake/mkspecs/features/gn_generator.prf36
3 files changed, 55 insertions, 14 deletions
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
index 759638877..48a1eb263 100644
--- a/tools/qmake/mkspecs/features/configure.prf
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -28,6 +28,12 @@ defineTest(runConfigure) {
qtConfig(printing-and-pdf): WEBENGINE_CONFIG += use_printing use_pdf
qtConfig(proprietary-codecs): WEBENGINE_CONFIG += use_proprietary_codecs
qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker
+ qtConfig(webrtc): WEBENGINE_CONFIG += use_webrtc
+ qtConfig(embedded): WEBENGINE_CONFIG += embedded_build
+ } else {
+ cross_compile: WEBENGINE_CONFIG += embedded_build
+ }
+ isQtMinimum(5, 9) {
qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code
}
@@ -36,14 +42,14 @@ defineTest(runConfigure) {
!config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
REQUIRED_PACKAGES = dbus-1 fontconfig
- !cross_compile: qtConfig(xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst
+ !contains(WEBENGINE_CONFIG, embedded_build): qtConfig(xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst
qtConfig(pulseaudio): REQUIRED_PACKAGES += libpulse
qtConfig(system-png): REQUIRED_PACKAGES += libpng
qtConfig(system-harfbuzz) {
packagesExist("\'harfbuzz >= 1.2.0\'"): WEBENGINE_CONFIG += use_system_harfbuzz
else: log("System harfbuzz is too old (min. version 1.2). Using Chromium's copy.$${EOL}")
}
- !cross_compile: REQUIRED_PACKAGES += libpci
+ !contains(WEBENGINE_CONFIG, embedded_build): REQUIRED_PACKAGES += libpci
for(package, $$list($$REQUIRED_PACKAGES)) {
!packagesExist($$package):skipBuild("Unmet dependency: $$package")
@@ -84,7 +90,7 @@ defineTest(runConfigure) {
WEBENGINE_CONFIG += use_bundled_snappy
}
- !cross_compile {
+ !contains(WEBENGINE_CONFIG, embedded_build) {
packagesExist(nss): WEBENGINE_CONFIG += use_nss
else: log("System NSS not found, BoringSSL will be used.$${EOL}")
}
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index a47e4b7e8..f3c2eb905 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -260,6 +260,11 @@ defineTest(isMinWinSDKVersion) {
requested_minor = $$2
WIN_SDK_VERSION = $$(WindowsSDKVersion)
+ isEmpty(WIN_SDK_VERSION)|equals(WIN_SDK_VERSION, "\\") {
+ skipBuild("Could not detect Windows SDK version (\'WindowsSDKVersion\' environment variable is not set).")
+ return(false)
+ }
+
# major.0.minor
major_version = $$section(WIN_SDK_VERSION, ., 0, 0)
minor_version = $$section(WIN_SDK_VERSION, ., 2, 2)
@@ -381,19 +386,23 @@ defineReplace(buildNinja) {
!exists($$out) {
mkpath($$dirname(out))
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- ninja_configure = $$absolute_path(ninja/configure.py, $$src_3rd_party_dir)
- system("cd $$system_quote($$system_path($$dirname(out))) && python $$system_quote($$system_path($$ninja_configure)) --bootstrap")
+ ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir)))
+ !system("cd $$system_quote($$system_path($$dirname(out))) && python $$ninja_configure --bootstrap") {
+ error("NINJA build error!")
+ }
}
}
defineReplace(gnPath) {
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(chromium/tools/gn/gn, $$src_3rd_party_dir))
+ out = $$shadowed($$absolute_path(chromium/tools/gn/out/Release/gn, $$src_3rd_party_dir))
+
win32: out = $${out}.exe
return($$out)
}
defineReplace(buildGn) {
+ gn_args = $$1
out = $$gnPath()
!qtConfig(system-ninja): ninja_path = "--path $$ninjaPath()"
# check if it is not already build
@@ -401,9 +410,11 @@ defineReplace(buildGn) {
mkpath($$dirname(out))
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
gn_bootstrap = $$system_path($$absolute_path(chromium/tools/gn/bootstrap/bootstrap.py, $$src_3rd_party_dir))
- gn_args = $$system_quote(is_clang=false use_sysroot=false enable_remoting=false enable_nacl=false)
+ gn_args = $$system_quote($$gn_args)
gn_configure = $$system_quote($$gn_bootstrap) --shadow --gn-gen-args=$$gn_args $$ninja_path
- system("cd $$system_quote($$system_path($$dirname(out))) && python $$gn_configure")
+ !system("cd $$system_quote($$system_path($$dirname(out))) && python $$gn_configure") {
+ error("GN build error!")
+ }
}
}
diff --git a/tools/qmake/mkspecs/features/gn_generator.prf b/tools/qmake/mkspecs/features/gn_generator.prf
index c5f283a99..ccc2831ae 100644
--- a/tools/qmake/mkspecs/features/gn_generator.prf
+++ b/tools/qmake/mkspecs/features/gn_generator.prf
@@ -10,6 +10,18 @@ defineReplace(getTargetType) {
return("none")
}
+defineReplace(filter_flag_values) {
+ value_to_check = $$1
+ macos:equals(value_to_check, "$(EXPORT_ARCH_ARGS)") {
+ # EXPORT_ARCH_ARGS comes from qtbase/mkspecs/features/mac/default_post.prf which is a way
+ # to figure out the architectures to pass to the compiler at Makefile time. Because this
+ # variable expansion is not supported by GN, we filter it out. GN takes care of assigning
+ # the architecture itself.
+ return("")
+ }
+ return($$value_to_check)
+}
+
isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn)
isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py"
isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py"
@@ -93,7 +105,7 @@ GN_CONTENTS += "}"
TARGET_TYPE = $$getTargetType()
GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {"
-
+!isEmpty(GN_CREATE_PRI): GN_CONTENTS += " create_pri_file = $$GN_CREATE_PRI"
!isEmpty(GN_IMPORTS) {
for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")"
}
@@ -106,12 +118,19 @@ for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")"
!isEmpty(QMAKE_CFLAGS) {
GN_CONTENTS += " cflags = ["
- for(flag, QMAKE_CFLAGS): GN_CONTENTS += " \"$$flag\","
+ for(flag, QMAKE_CFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
GN_CONTENTS += " ]"
}
+
+# Stop the barrage of unused variables warnings.
+gcc|clang {
+ QMAKE_CXXFLAGS += "-Wno-unused-parameter"
+ QMAKE_CXXFLAGS += "-Wno-unused-variable"
+}
+
!isEmpty(QMAKE_CXXFLAGS) {
GN_CONTENTS += " cflags_cc = ["
- for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$flag\","
+ for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
GN_CONTENTS += " ]"
}
@@ -119,7 +138,9 @@ GN_CONTENTS += " if (!defined(defines)) {"\
" defines = []"\
" }"
GN_CONTENTS += " defines += ["
-for (define, DEFINES): GN_CONTENTS += " \"$$define\","
+# Remove single quotes around function macro defines, so that GN doesn't escape them, thus breaking
+# the macro.
+for (define, DEFINES): GN_CONTENTS += " \"$$replace(define,\',)\","
!isEmpty(QMAKE_LIBDIR_EGL):
GN_CONTENTS += " \"QT_LIBDIR_EGL=\\\"$${QMAKE_DIR_SEP}$$relative_path($$QMAKE_LIBDIR_EGL, $$[QT_SYSROOT])\\\"\","
!isEmpty(QMAKE_LIBDIR_OPENGL_ES2)
@@ -147,9 +168,12 @@ GN_CONTENTS += " if (!defined(ldflags)) {"\
" ldflags = []"\
" }"
GN_CONTENTS += " ldflags += ["
-for (flag, QMAKE_LFLAGS): GN_CONTENTS += " \"$$flag\","
+for (flag, QMAKE_LFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\","
-!isEmpty(QMAKE_RPATHDIR): GN_CONTENTS += " \"-Wl,-rpath=$${QMAKE_RPATHDIR}\","
+!isEmpty(QMAKE_RPATHDIR) {
+ macos: GN_CONTENTS += " \"-Wl,-rpath,$${QMAKE_RPATHDIR}\","
+ else:unix: GN_CONTENTS += " \"-Wl,-rpath=$${QMAKE_RPATHDIR}\","
+}
!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\","
GN_CONTENTS += " ]"