summaryrefslogtreecommitdiffstats
path: root/src/core/config/windows.pri
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/config/windows.pri')
-rw-r--r--src/core/config/windows.pri43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index f7644c83b..1e875f308 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -28,3 +28,46 @@ contains(QT_CONFIG, angle) {
GYP_ARGS += "-D qt_gl=\"opengl\""
}
+defineTest(usingMSVC32BitCrossCompiler) {
+ CL_DIR =
+ for(dir, QMAKE_PATH_ENV) {
+ exists($$dir/cl.exe) {
+ CL_DIR = $$dir
+ break()
+ }
+ }
+ isEmpty(CL_DIR): {
+ warning(Cannot determine location of cl.exe.)
+ return(false)
+ }
+ CL_DIR = $$system_path($$CL_DIR)
+ CL_DIR = $$split(CL_DIR, \\)
+ CL_PLATFORM = $$last(CL_DIR)
+ equals(CL_PLATFORM, amd64_x86): return(true)
+ return(false)
+}
+
+msvc {
+ equals(MSVC_VER, 12.0) {
+ MSVS_VERSION = 2013
+ } else:equals(MSVC_VER, 14.0) {
+ MSVS_VERSION = 2015
+ } else {
+ fatal("Visual Studio compiler version \"$$MSVC_VER\" is not supported by Qt WebEngine")
+ }
+
+ GYP_ARGS += "-G msvs_version=$$MSVS_VERSION"
+
+ # 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): GYP_ARGS += "-D windows_sdk_path=\"C:/Program Files/Windows Kits/8.1\""
+
+ contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
+ # The 32 bit MSVC linker runs out of memory if we do not remove all debug information.
+ GYP_CONFIG += fastbuild=2
+ }
+} else {
+ fatal("Qt WebEngine for Windows can only be built with the Microsoft Visual Studio C++ compiler")
+}