diff options
Diffstat (limited to 'mkspecs')
93 files changed, 1620 insertions, 494 deletions
diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf index 1f5e690329..dd29473969 100644 --- a/mkspecs/android-clang/qmake.conf +++ b/mkspecs/android-clang/qmake.conf @@ -29,8 +29,11 @@ else: equals(ANDROID_TARGET_ARCH, mips): \ else: equals(ANDROID_TARGET_ARCH, mips64): \ QMAKE_CFLAGS += -target mips64el-none-linux-android -QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a +QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info + +QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a +equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a + QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \ -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \ @@ -41,11 +44,11 @@ ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$A ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so +ANDROID_USE_LLVM = true + exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \ ANDROID_CXX_STL_LIBS = -lc++ else: \ ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "") -QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz - include(../common/android-base-tail.conf) diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf index e72c802405..0cb3558f96 100644 --- a/mkspecs/android-g++/qmake.conf +++ b/mkspecs/android-g++/qmake.conf @@ -16,6 +16,7 @@ QMAKE_LINK = $$QMAKE_CXX ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ARCH ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libgnustl_shared.so ANDROID_CXX_STL_LIBS = -lgnustl_shared -lgcc +ANDROID_USE_LLVM = false exists($$NDK_ROOT/sysroot/usr/include): \ QMAKE_CFLAGS += --sysroot=$$NDK_ROOT/sysroot \ diff --git a/mkspecs/common/android-base-head.conf b/mkspecs/common/android-base-head.conf index c7c27298b9..a43fc7f23e 100644 --- a/mkspecs/common/android-base-head.conf +++ b/mkspecs/common/android-base-head.conf @@ -4,9 +4,7 @@ load(device_config) isEmpty(DEFAULT_ANDROID_NDK_ROOT): return() NDK_ROOT = $$(ANDROID_NDK_ROOT) -!exists($$NDK_ROOT) { - NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT -} +isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT NDK_HOST = $$(ANDROID_NDK_HOST) isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST @@ -69,10 +67,6 @@ CONFIG += $$ANDROID_PLATFORM QMAKE_CFLAGS = -D__ANDROID_API__=$$replace(ANDROID_PLATFORM, "android-", "") ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/ -ANDROID_PLATFORM_PATH = $$ANDROID_PLATFORM_ROOT_PATH/usr - -equals(ANDROID_TARGET_ARCH, x86_64)|equals(ANDROID_TARGET_ARCH, mips64): \ - QMAKE_ANDROID_PLATFORM_LIBDIR = $${QMAKE_ANDROID_PLATFORM_LIBDIR}64 CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX- diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf index e239fa01c5..f403ef9330 100644 --- a/mkspecs/common/android-base-tail.conf +++ b/mkspecs/common/android-base-tail.conf @@ -69,7 +69,6 @@ QMAKE_LIBDIR_OPENGL = QMAKE_LINK_SHLIB = $$QMAKE_LINK QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH -QMAKE_RPATHLINK = $$QMAKE_ANDROID_PLATFORM_LIBDIR QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB @@ -88,6 +87,3 @@ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 !exists($$NDK_ROOT): error("You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.") load(qt_config) - -QMAKE_DEFAULT_LIBDIRS = $$QMAKE_LIBDIR -QMAKE_DEFAULT_INCDIRS = $$QMAKE_INCDIR diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf index 5800aaa5b4..1666843136 100644 --- a/mkspecs/common/clang.conf +++ b/mkspecs/common/clang.conf @@ -16,10 +16,13 @@ QMAKE_LINK_SHLIB = $$QMAKE_CXX CONFIG += clang_pch_style QMAKE_PCH_OUTPUT_EXT = .pch +QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz + QMAKE_CFLAGS_ISYSTEM = -isystem QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT} -QMAKE_CFLAGS_LTCG = -flto +QMAKE_CFLAGS_LTCG = -flto=thin +QMAKE_CFLAGS_LTCG_FATOBJECTS = -flto QMAKE_CFLAGS_DISABLE_LTCG = -fno-lto QMAKE_CFLAGS_GNUC99 = -std=gnu99 QMAKE_CFLAGS_GNUC11 = -std=gnu11 @@ -27,6 +30,7 @@ QMAKE_CFLAGS_GNUC11 = -std=gnu11 QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG QMAKE_CXXFLAGS_CXX11 = -std=c++11 QMAKE_CXXFLAGS_CXX14 = -std=c++1y @@ -44,3 +48,7 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_AR_LTCG = llvm-ar cqs QMAKE_NM_LTCG = llvm-nm -P QMAKE_RANLIB_LTCG = true # No need to run, since llvm-ar has "s" + +QMAKE_CFLAGS_COVERAGE_TRACE_PC_GUARD = -fsanitize-coverage=trace-pc-guard +QMAKE_CXXFLAGS_COVERAGE_TRACE_PC_GUARD = -fsanitize-coverage=trace-pc-guard +QMAKE_LFLAGS_COVERAGE_TRACE_PC_GUARD = -fsanitize-coverage=trace-pc-guard diff --git a/mkspecs/common/g++-win32.conf b/mkspecs/common/g++-win32.conf index f0df324b64..c3a1f3a373 100644 --- a/mkspecs/common/g++-win32.conf +++ b/mkspecs/common/g++-win32.conf @@ -31,8 +31,6 @@ QMAKE_YACCFLAGS = -d QMAKE_CFLAGS_SSE2 += -mstackrealign -QMAKE_CXXFLAGS_RTTI_ON = -frtti -QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads QMAKE_INCDIR = diff --git a/mkspecs/common/gcc-base-unix.conf b/mkspecs/common/gcc-base-unix.conf index 700f228c36..a456c8f3eb 100644 --- a/mkspecs/common/gcc-base-unix.conf +++ b/mkspecs/common/gcc-base-unix.conf @@ -20,7 +20,9 @@ QMAKE_LFLAGS_RPATH = -Wl,-rpath, QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link, QMAKE_LFLAGS_NEW_DTAGS = -Wl,--enable-new-dtags QMAKE_LFLAGS_GDB_INDEX = -Wl,--gdb-index +QMAKE_LFLAGS_USE_BFD = -fuse-ld=bfd QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold +QMAKE_LFLAGS_USE_LLD = -fuse-ld=lld # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf index c2669e4833..44b4267207 100644 --- a/mkspecs/common/gcc-base.conf +++ b/mkspecs/common/gcc-base.conf @@ -68,6 +68,8 @@ QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden QMAKE_CXXFLAGS_EXCEPTIONS_OFF += $$QMAKE_CFLAGS_EXCEPTIONS_OFF +QMAKE_CXXFLAGS_RTTI_ON = -frtti +QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti QMAKE_CXXFLAGS_SPLIT_SECTIONS += $$QMAKE_CFLAGS_SPLIT_SECTIONS QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index 61bea952b2..f21ba5ec51 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -14,9 +14,10 @@ include(unix.conf) QMAKE_RESOURCE = /Developer/Tools/Rez QMAKE_EXTENSION_SHLIB = dylib +QMAKE_EXTENSIONS_AUX_SHLIB = tbd QMAKE_LIBDIR = -# sdk.prf will prefix the proper SDK sysroot +# qtConfLibrary_openglMakeSpec will prefix the proper SDK sysroot QMAKE_INCDIR_OPENGL = \ /System/Library/Frameworks/OpenGL.framework/Headers \ /System/Library/Frameworks/AGL.framework/Headers/ diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf index d61ad33351..889027ada5 100644 --- a/mkspecs/common/macx.conf +++ b/mkspecs/common/macx.conf @@ -7,7 +7,8 @@ QMAKE_MAC_SDK = macosx QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12 QMAKE_APPLE_DEVICE_ARCHS = x86_64 -QT_MAC_SDK_VERSION_TESTED_WITH = 10.14 +QT_MAC_SDK_VERSION_MIN = 10.13 +QT_MAC_SDK_VERSION_MAX = 10.14 device.sdk = macosx device.target = device diff --git a/mkspecs/common/msvc-based-version.conf b/mkspecs/common/msvc-based-version.conf new file mode 100644 index 0000000000..38aecbaf59 --- /dev/null +++ b/mkspecs/common/msvc-based-version.conf @@ -0,0 +1,32 @@ +# +# qmake configuration for Compilers based on the Microsoft Visual Studio +# C/C++ Compilers like win32-clang-msvc + +# +# Version-specific changes +# + +isEmpty(QMAKE_MSC_VER): error("msvc-based-version.conf loaded but QMAKE_MSC_VER isn't set") + +MSVC_VER = 14.0 +COMPAT_MKSPEC = win32-msvc2015 + +# -utf-8 compiler option for Visual Studio 2015 Update 2 +greaterThan(QMAKE_MSC_FULL_VER, 190023918):!intel_icl { + isEmpty(QT_CLANG_MAJOR_VERSION)|!lessThan(QT_CLANG_MAJOR_VERSION, 4) { + QMAKE_CFLAGS_UTF8_SOURCE = -utf-8 + } +} + +greaterThan(QMAKE_MSC_VER, 1909) { + # Visual Studio 2017 (15.0) / Visual C++ 19.10 and up + MSVC_VER = 15.0 + COMPAT_MKSPEC = win32-msvc2017 +} + +greaterThan(QMAKE_MSC_VER, 1910) { + # No compat spec past MSVC 2017 + COMPAT_MKSPEC = +} + +!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index a4fadeb029..0b94e5a3f5 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -106,7 +106,7 @@ QMAKE_LIBS_OPENGL_ES2_DEBUG = gdi32.lib user32.lib QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_IDL = midl /NOLOGO +QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO QMAKE_RC = rc /NOLOGO @@ -115,4 +115,5 @@ VCSOLUTION_EXTENSION = .sln VCPROJ_KEYWORD = Qt4VSv1.0 include(angle.conf) +include(windows-desktop.conf) include(windows-vulkan.conf) diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index 3fb55c9d81..06af6abf13 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -1,7 +1,6 @@ # # qmake configuration for Microsoft Visual Studio C/C++ Compiler -# This file is used by win32-msvc, win32-clang-msvc, and all -# winrt-XXX-msvcXXX specs +# This file is used by win32-msvc and all winrt-XXX-msvcXXX specs # # @@ -70,11 +69,8 @@ greaterThan(QMAKE_MSC_VER, 1899) { QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -wd4467 - greaterThan(QMAKE_MSC_FULL_VER, 190023918):!intel_icl { - isEmpty(QT_CLANG_MAJOR_VERSION)|!lessThan(QT_CLANG_MAJOR_VERSION, 4) { - QMAKE_CFLAGS_UTF8_SOURCE = -utf-8 - } - } + # -utf-8 compiler option for Visual Studio 2015 Update 2 + greaterThan(QMAKE_MSC_FULL_VER, 190023918): QMAKE_CFLAGS_UTF8_SOURCE = -utf-8 } greaterThan(QMAKE_MSC_VER, 1909) { @@ -117,4 +113,9 @@ greaterThan(QMAKE_MSC_VER, 1910) { COMPAT_MKSPEC = } +greaterThan(QMAKE_MSC_VER, 1919) { + # Visual Studio 2019 (16.0) / Visual C++ 19.20 and up + MSVC_VER = 16.0 +} + !isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC diff --git a/mkspecs/common/windows-desktop.conf b/mkspecs/common/windows-desktop.conf new file mode 100644 index 0000000000..c1f2955e1b --- /dev/null +++ b/mkspecs/common/windows-desktop.conf @@ -0,0 +1,5 @@ +# This file contains initializations for Windows Desktop platforms (non-UWP) + +WINDOWS_TARGET_PLATFORM_VERSION = $$(WindowsSDKVersion) +# The version number might have a trailing backslash due to a VS bug. +WINDOWS_TARGET_PLATFORM_VERSION ~= s/\\\\$// diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index 375e084127..03fb96f2c5 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -97,6 +97,8 @@ WINRT_ASSETS_PATH = $$PWD/assets WINRT_MANIFEST.capabilities = defaults WINRT_MANIFEST.capabilities_device = defaults +WINDOWS_TARGET_PLATFORM_VERSION = $$(UCRTVERSION) + include(../angle.conf) load(qt_config) diff --git a/mkspecs/devices/common/linux_device_pre.conf b/mkspecs/devices/common/linux_device_pre.conf index 8c6c87d0b7..5b6a9bfcfa 100644 --- a/mkspecs/devices/common/linux_device_pre.conf +++ b/mkspecs/devices/common/linux_device_pre.conf @@ -24,5 +24,9 @@ QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip +# modifications to gcc-base.conf +QMAKE_AR_LTCG = $${CROSS_COMPILE}gcc-ar cqs +QMAKE_NM_LTCG = $${CROSS_COMPILE}gcc-nm -P + contains(DISTRO_OPTS, deb-multi-arch): \ QMAKE_PKG_CONFIG = $${CROSS_COMPILE}pkg-config diff --git a/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf b/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf index e78bde54b9..7fc6c6aafc 100644 --- a/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf +++ b/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf @@ -33,9 +33,6 @@ gl_lib_directory = $$(GL_LIB_DIR) isEmpty(gl_lib_directory): \ error("This qmakespec requires $GL_LIB_DIR to be set") -QMAKE_LIBDIR += $$(QCLIBS_DIR)/base -QMAKE_LIBDIR += $$(QCLIBS_DIR)/multimedia/display - QMAKE_INCDIR += $$(QC_MULTIMEDIA_INC_DIR) QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -lmmosallibrary @@ -51,7 +48,12 @@ QMAKE_LFLAGS += -bigswitch # OpenGL libraries have a dependency on libEGL QMAKE_INCDIR_EGL = $$(GL_INC_DIR) QMAKE_LIBDIR_EGL = $$(GL_LIB_DIR) +QMAKE_LIBDIR_EGL += $$(QCLIBS_DIR)/base +QMAKE_LIBDIR_EGL += $$(QCLIBS_DIR)/multimedia/display + QMAKE_INCDIR_OPENGL_ES2 = $$(GL_INC_DIR) QMAKE_LIBDIR_OPENGL_ES2 = $$(GL_LIB_DIR) +QMAKE_LIBDIR_OPENGL_ES2 += $$(QCLIBS_DIR)/base +QMAKE_LIBDIR_OPENGL_ES2 += $$(QCLIBS_DIR)/multimedia/display load(qt_config) diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf index b72091373d..6ec7817efb 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf @@ -20,6 +20,10 @@ QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL} QMAKE_LIBS_EGL = -lEGL -lGLESv2 QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2 +QMAKE_INCDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/include +QMAKE_LIBDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/lib +QMAKE_LIBS_BCM_HOST = -lbcm_host + contains(DISTRO, squeeze) { #Debian Squeeze: Legacy everything QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL diff --git a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf index ffe8f5739a..3b49f19a5b 100644 --- a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf @@ -16,6 +16,11 @@ QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL} QMAKE_LIBS_EGL = -lEGL -lGLESv2 QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2 + +QMAKE_INCDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/include +QMAKE_LIBDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/lib +QMAKE_LIBS_BCM_HOST = -lbcm_host + QMAKE_CFLAGS += -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux QMAKE_CXXFLAGS = $$QMAKE_CFLAGS diff --git a/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf index 2bb70ffb5a..b215833486 100644 --- a/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf @@ -31,6 +31,10 @@ QMAKE_LIBS_OPENGL_ES2 = $${VC_LINK_LINE} -lGLESv2 # The official opt vc EGL references GLESv2 symbols: need to link it QMAKE_LIBS_EGL = $${VC_LINK_LINE} -lEGL -lGLESv2 +QMAKE_LIBDIR_BCM_HOST = $$VC_LIBRARY_PATH +QMAKE_INCDIR_BCM_HOST = $$VC_INCLUDE_PATH +QMAKE_LIBS_BCM_HOST = -lbcm_host + QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 QMAKE_CXXFLAGS = $$QMAKE_CFLAGS diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf index e6b2431f9a..ad826bdad3 100644 --- a/mkspecs/features/android/android_deployment_settings.prf +++ b/mkspecs/features/android/android_deployment_settings.prf @@ -17,17 +17,22 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded { isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT FILE_CONTENT += " \"ndk\": $$emitString($$NDK_ROOT)," - NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX) - isEmpty(NDK_TOOLCHAIN_PREFIX) { - equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86 - else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64 - else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android - else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android - else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android - else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi + equals(ANDROID_USE_LLVM, true) { + FILE_CONTENT += " \"toolchain-prefix\": \"llvm\"," + FILE_CONTENT += " \"tool-prefix\": \"llvm\"," + } else { + NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX) + isEmpty(NDK_TOOLCHAIN_PREFIX) { + equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86 + else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64 + else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android + else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android + else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android + else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi + } + FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX)," + FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX)," } - FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX)," - FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX)," NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION) isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION @@ -53,6 +58,14 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded { !isEmpty(ANDROID_PACKAGE_SOURCE_DIR): \ FILE_CONTENT += " \"android-package-source-directory\": $$emitString($$ANDROID_PACKAGE_SOURCE_DIR)," + # Android-specific version string + !isEmpty(ANDROID_VERSION_NAME): \ + FILE_CONTENT += " \"android-version-name\": $$emitString($$ANDROID_VERSION_NAME)," + + # Android-specific version number + !isEmpty(ANDROID_VERSION_CODE): \ + FILE_CONTENT += " \"android-version-code\": $$emitString($$ANDROID_VERSION_CODE)," + !isEmpty(ANDROID_EXTRA_LIBS): \ FILE_CONTENT += " \"android-extra-libs\": $$emitString($$join(ANDROID_EXTRA_LIBS, ","))," @@ -63,6 +76,7 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded { QML_ROOT_PATH = $$_PRO_FILE_PWD_ FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH)," FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH)," + FILE_CONTENT += " \"useLLVM\": $$ANDROID_USE_LLVM," FILE_CONTENT += " \"application-binary\": $$emitString($$absolute_path($$DESTDIR, $$OUT_PWD)/$$TARGET)" FILE_CONTENT += "}" diff --git a/mkspecs/features/android/sdk.prf b/mkspecs/features/android/sdk.prf index eee7ac2d5d..fe7b9a27bd 100644 --- a/mkspecs/features/android/sdk.prf +++ b/mkspecs/features/android/sdk.prf @@ -1,6 +1,6 @@ API_VERSION_TO_USE = $$(ANDROID_API_VERSION) isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION -isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-16 +isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-21 ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar !exists($$ANDROID_JAR_FILE) { diff --git a/mkspecs/features/cmdline.prf b/mkspecs/features/cmdline.prf new file mode 100644 index 0000000000..f9d90d3a50 --- /dev/null +++ b/mkspecs/features/cmdline.prf @@ -0,0 +1,2 @@ +win32: CONFIG *= console +macos: CONFIG -= app_bundle diff --git a/mkspecs/features/coverage.prf b/mkspecs/features/coverage.prf new file mode 100644 index 0000000000..b8b37e1b80 --- /dev/null +++ b/mkspecs/features/coverage.prf @@ -0,0 +1,7 @@ +# Coverage flags + +coverage_trace_pc_guard { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_COVERAGE_TRACE_PC_GUARD + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_COVERAGE_TRACE_PC_GUARD + QMAKE_LFLAGS += $$QMAKE_LFLAGS_COVERAGE_TRACE_PC_GUARD +} diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 2ed708e085..6bf1380716 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -200,7 +200,9 @@ CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";") CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";") CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";") -CMAKE_QT_STEM = Qt$$QT_MAJOR_VERSION$${CMAKE_MODULE_NAME}$${QT_LIBINFIX} +# TARGET here is the one changed at the end of qt_module.prf, +# which already contains the Qt5 prefix and QT_LIBINFIX suffix +CMAKE_QT_STEM = $${TARGET} mac { !isEmpty(CMAKE_STATIC_TYPE) { diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf index 0d5ff5f89c..ea90bf89cd 100644 --- a/mkspecs/features/ctest_testcase_common.prf +++ b/mkspecs/features/ctest_testcase_common.prf @@ -48,8 +48,8 @@ for (dep, dependentmodules): \ dependentmodules = $$join(mod_deps, ";") QT_FOR_CONFIG += gui-private -qtConfig(angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True -!qtConfig(egl): CMAKE_GL_DEFINES += -DNO_EGL=True +qtHaveModule(gui):qtConfig(angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True +qtHaveModule(gui):!qtConfig(egl): CMAKE_GL_DEFINES += -DNO_EGL=True CMAKE_MODULE_VERSIONS = CMAKE_MODULES_UNDER_TEST = @@ -65,7 +65,8 @@ for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) { CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;) check.commands = \ - $(MKDIR) $$BUILD_DIR && $$QMAKE_CD $$BUILD_DIR && \ + $$sprintf($$QMAKE_MKDIR_CMD, $$BUILD_DIR) $$escape_expand(\\n\\t) \ + $$QMAKE_CD $$BUILD_DIR && \ cmake $$CMAKE_TEST_LOCATION $$CMAKE_GENERATOR \ -DCMAKE_C_COMPILER=$$QMAKE_CC \ -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \ diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 3ed6dd5889..b643e5edf9 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -48,6 +48,60 @@ but not all the files it references. endif() endmacro() +!!IF !isEmpty(CMAKE_STATIC_TYPE) +function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configuration lib_deps link_flags) + set(_lib_deps) + set(_link_flags) + + get_filename_component(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib\" ABSOLUTE) + + if(EXISTS \"${prl_file_location}\") + file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS[ \\t]*=\") + string(REGEX REPLACE \"QMAKE_PRL_LIBS[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends ${_prl_strings}) + string(REGEX REPLACE \"[ \\t]+\" \";\" _static_depends ${_static_depends}) + set(_search_paths) + string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\") + foreach(_flag ${_static_depends}) + string(REPLACE \"\\\"\" \"\" _flag ${_flag}) + if(_flag MATCHES \"^-l(.*)$\") + # Handle normal libraries passed as -lfoo + set(_lib \"${CMAKE_MATCH_1}\") + if(_lib MATCHES \"^pthread$\") + find_package(Threads REQUIRED) + list(APPEND _lib_deps Threads::Threads) + else() + if(_search_paths) + find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib} HINTS ${_search_paths} NO_DEFAULT_PATH) + endif() + find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib}) + mark_as_advanced(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH) + if(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH) + list(APPEND _lib_deps + ${_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH} + ) + else() + message(FATAL_ERROR \"Library not found: ${_lib}\") + endif() + endif() + elseif(EXISTS \"${_flag}\") + # The flag is an absolute path to an existing library + list(APPEND _lib_deps \"${_flag}\") + elseif(_flag MATCHES \"^-L(.*)$\") + # Handle -Lfoo flags by putting their paths in the search path used by find_library above + list(APPEND _search_paths \"${CMAKE_MATCH_1}\") + else() + # Handle all remaining flags by simply passing them to the linker + list(APPEND _link_flags ${_flag}) + endif() + endforeach() + endif() + + string(REPLACE \";\" \" \" _link_flags \"${_link_flags}\") + set(${lib_deps} ${_lib_deps} PARENT_SCOPE) + set(${link_flags} \"SHELL:${_link_flags}\" PARENT_SCOPE) +endfunction() +!!ENDIF + !!IF !equals(TEMPLATE, aux) macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) @@ -58,15 +112,29 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) + set(_deps + ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES} +!!IF !isEmpty(CMAKE_STATIC_TYPE) + ${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES} +!!ENDIF + ) set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES - \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\" + \"INTERFACE_LINK_LIBRARIES\" \"${_deps}\" \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} !!IF !isEmpty(CMAKE_LIB_SONAME) \"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\" !!ENDIF # For backward compatibility with CMake < 2.8.12 - \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\" + \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps}\" ) +!!IF !isEmpty(CMAKE_STATIC_TYPE) + + if(NOT CMAKE_VERSION VERSION_LESS \"3.13\") + set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES + \"INTERFACE_LINK_OPTIONS\" \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\" + ) + endif() +!!ENDIF !!IF !isEmpty(CMAKE_WINDOWS_BUILD) !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) @@ -215,6 +283,40 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ENDIF !!IF !isEmpty(CMAKE_STATIC_TYPE) + if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES) +!!IF !isEmpty(CMAKE_DEBUG_TYPE) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LINK_FLAGS + ) +!!ELSE + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LINK_FLAGS + ) +!!ENDIF +!!ENDIF + +!!IF !isEmpty(CMAKE_RELEASE_TYPE) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LINK_FLAGS + ) +!!ELSE + _qt5_$${CMAKE_MODULE_NAME}_process_prl_file( + \"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES + _Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LINK_FLAGS + ) +!!ENDIF +!!ENDIF + endif() + add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") !!ELSE diff --git a/mkspecs/features/data/configure.json b/mkspecs/features/data/configure.json index 167c502e82..faa89231a0 100644 --- a/mkspecs/features/data/configure.json +++ b/mkspecs/features/data/configure.json @@ -17,5 +17,15 @@ "list-features": "void", "list-libraries": "void" } + }, + + "testTypeDependencies": { + "library": [ "library-paths" ] + }, + + "features": { + "library-paths": { + "output": [ "libraryPaths" ] + } } } diff --git a/mkspecs/features/data/dumpvcvars.bat b/mkspecs/features/data/dumpvcvars.bat new file mode 100644 index 0000000000..4721da2e39 --- /dev/null +++ b/mkspecs/features/data/dumpvcvars.bat @@ -0,0 +1,44 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2018 The Qt Company Ltd. +:: Contact: https://www.qt.io/licensing/ +:: +:: This file is part of the tools applications of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:GPL-EXCEPT$ +:: Commercial License Usage +:: Licensees holding valid commercial Qt licenses may use this file in +:: accordance with the commercial license agreement provided with the +:: Software or, alternatively, in accordance with the terms contained in +:: a written agreement between you and The Qt Company. For licensing terms +:: and conditions see https://www.qt.io/terms-conditions. For further +:: information use the contact form at https://www.qt.io/contact-us. +:: +:: GNU General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU +:: General Public License version 3 as published by the Free Software +:: Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +:: included in the packaging of this file. Please review the following +:: information to ensure the GNU General Public License requirements will +:: be met: https://www.gnu.org/licenses/gpl-3.0.html. +:: +:: $QT_END_LICENSE$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +@echo off + +REM We clear INCLUDE and LIB, because we want to obtain pristine values. +REM PATH cannot be cleared, because then the script does not even run, +REM and it would be counterproductive anyway (see toolchain.prf). +set INCLUDE= +set LIB= + +call %* || exit 1 +REM VS2015 does not set errorlevel in case of failure. +if "%INCLUDE%" == "" exit 1 + +echo =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= +echo %INCLUDE% +echo %LIB% +echo %PATH% diff --git a/mkspecs/features/data/mac/objc_namespace.sh b/mkspecs/features/data/mac/objc_namespace.sh index 6ac004fe2d..ceff2df324 100755 --- a/mkspecs/features/data/mac/objc_namespace.sh +++ b/mkspecs/features/data/mac/objc_namespace.sh @@ -146,7 +146,7 @@ inspect_binary() { echo "found namespaced class names, updating class entries..." fi - classes=$(otool -o "$target" | grep class_ro_t) + classes=$(otool -o -v "$target" | grep class_ro_t) while read -a class; do address="$(sanitize_address ${class[1]})" diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index ad4a5f6365..69da78c5b7 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -78,7 +78,9 @@ stack_protector_strong { # disable special linker flags for host builds (no proper test for host support yet) !host_build|!cross_compile { + use_bfd_linker: QMAKE_LFLAGS += $$QMAKE_LFLAGS_USE_BFD use_gold_linker: QMAKE_LFLAGS += $$QMAKE_LFLAGS_USE_GOLD + use_lld_linker: QMAKE_LFLAGS += $$QMAKE_LFLAGS_USE_LLD enable_new_dtags: QMAKE_LFLAGS += $$QMAKE_LFLAGS_NEW_DTAGS enable_gdb_index: QMAKE_LFLAGS += $$QMAKE_LFLAGS_GDB_INDEX } @@ -90,6 +92,10 @@ staticlib:unix { QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_STATIC_LIB } +defined(WINDOWS_TARGET_PLATFORM_VERSION, var):isEmpty(WINDOWS_TARGET_PLATFORM_MIN_VERSION) { + WINDOWS_TARGET_PLATFORM_MIN_VERSION = $$WINDOWS_TARGET_PLATFORM_VERSION +} + incredibuild_xge { CONFIG -= incredibuild_xge CONFIG = incredibuild_xge $$CONFIG @@ -113,6 +119,8 @@ breakpad { !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME) } +c++17: CONFIG += c++1z + !c++11:!c++14:!c++1z { # Qt requires C++11 since 5.7, check if we need to force a compiler option QT_COMPILER_STDCXX_no_L = $$replace(QT_COMPILER_STDCXX, "L$", "") diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf index 9fa0c9e219..4577785576 100644 --- a/mkspecs/features/egl.prf +++ b/mkspecs/features/egl.prf @@ -2,6 +2,7 @@ INCLUDEPATH += $$QMAKE_INCDIR_EGL LIBS_PRIVATE += $$QMAKE_LIBS_EGL QMAKE_CFLAGS += $$QMAKE_CFLAGS_EGL QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EGL +DEFINES += $$QMAKE_DEFINES_EGL LIBS += $$QMAKE_LFLAGS_EGL for(p, QMAKE_LIBDIR_EGL) { LIBS_PRIVATE += -L$$p diff --git a/mkspecs/features/file_copies.prf b/mkspecs/features/file_copies.prf index 58e07bd393..8a718d8a81 100644 --- a/mkspecs/features/file_copies.prf +++ b/mkspecs/features/file_copies.prf @@ -44,7 +44,9 @@ for (cp, COPIES) { $${pfx}.output = $$path/${QMAKE_FUNC_FILE_IN_qtStripSrcDir_$$cp} } $${pfx}.input = $${pfx}.files - $${pfx}.commands = $(QINSTALL) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + contains(TEMPLATE, "vc.*"): copycommand = $$QMAKE_QMAKE -install qinstall + else: copycommand = $(QINSTALL) + $${pfx}.commands = $$copycommand ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} $${pfx}.name = COPY ${QMAKE_FILE_IN} $${pfx}.CONFIG = no_link no_clean target_predeps QMAKE_EXTRA_COMPILERS += $${pfx} diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf index ccf0226272..d113caf35c 100644 --- a/mkspecs/features/ltcg.prf +++ b/mkspecs/features/ltcg.prf @@ -2,7 +2,7 @@ CONFIG(release, debug|release) { # We need fat object files when creating static libraries on some platforms # so the linker will know to load a particular object from the library # in the first place. On others, we have special ar and nm to create the symbol - # tables so the linker will know better. For other compilers, we disable LTCG + # tables so the linker will know better. For other compilers, we disable LTCG # for static libraries. msvc { # Nothing to do diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf index 123a0e0fcd..58211c13a2 100644 --- a/mkspecs/features/mac/asset_catalogs.prf +++ b/mkspecs/features/mac/asset_catalogs.prf @@ -110,7 +110,7 @@ # Backwards compatibility for (bundle_data, QMAKE_BUNDLE_DATA) { for (bundle_file, $${bundle_data}.files) { - !contains(bundle_file, .*\.xcassets$): next() + !contains(bundle_file, .*\\.xcassets$): next() warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.") !exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next() diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index ae17f076a3..c46222debd 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,27 +1,30 @@ load(default_post) contains(TEMPLATE, .*app) { - !macx-xcode { + !macx-xcode:if(isEmpty(BUILDS)|build_pass) { # Detect changes to the platform SDK - QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION + QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_XCODE_DEVELOPER_PATH QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk) } # Detect incompatible SDK versions - !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION): \ - warning("Qt requires at least version $$QT_MAC_SDK_VERSION of the platform SDK," \ + isEmpty(QT_MAC_SDK_VERSION_MIN): \ + QT_MAC_SDK_VERSION_MIN = $$QT_MAC_SDK_VERSION + + !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION_MIN): \ + warning("Qt requires at least version $$QT_MAC_SDK_VERSION_MIN of the platform SDK," \ "you're using $${QMAKE_MAC_SDK_VERSION}. Please upgrade.") - !isEmpty(QT_MAC_SDK_VERSION_TESTED_WITH) { + !isEmpty(QT_MAC_SDK_VERSION_MAX) { # For Qt developers only !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \ CONFIG += sdk_no_version_check - QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\d+)(\.\d+)(\.\d+)?", \1\2) + QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1\\2) - !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_TESTED_WITH) { - warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_TESTED_WITH"\ + !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) { + warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\ "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_MINOR_VERSION}.") warning("This is an unsupported configuration. You may experience build issues," \ "and by using") @@ -29,7 +32,7 @@ contains(TEMPLATE, .*app) { "that Qt has not been prepared for.") warning("Please downgrade the SDK you use to build your app to version" \ - "$$QT_MAC_SDK_VERSION_TESTED_WITH, or configure") + "$$QT_MAC_SDK_VERSION_MAX, or configure") warning("with CONFIG+=sdk_no_version_check when running qmake" \ "to silence this warning.") } @@ -64,7 +67,7 @@ qt { # Add the same default rpaths as Xcode does for new projects. # This is especially important for iOS/tvOS/watchOS where no other option is possible. !no_default_rpath { - QMAKE_RPATHDIR += @executable_path/Frameworks + QMAKE_RPATHDIR += @executable_path/../Frameworks equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks } @@ -256,3 +259,10 @@ isEmpty(xcode_product_bundle_target): \ xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier} xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}" QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting + +!macx-xcode { + generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_) + generate_xcode_project.target = xcodeproj + QMAKE_EXTRA_VARIABLES += _PRO_FILE_ + QMAKE_EXTRA_TARGETS += generate_xcode_project +} diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk index a7c8268da5..c40f58c987 100644 --- a/mkspecs/features/mac/sdk.mk +++ b/mkspecs/features/mac/sdk.mk @@ -1,12 +1,25 @@ -CURRENT_MAC_SDK_VERSION := $(shell /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version) -ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION)) - $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).) - $(info This requires a fresh build. Please wipe the build directory completely,) - $(info including any .qmake.stash and .qmake.cache files generated by qmake.) - # FIXME: Ideally this should be advertised as just running make distclean, or we - # should even do it automatically by having proper makefile dependencies between - # .qmake.stash and the SDK version, but as qmake doesn't seem to be consistent in - # how it deals with .qmake.stash as a dependency we need to defer that until later. - $(error ^) +ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),) + CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>&1 + CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND)) + ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION)) + # We don't want to complain about out of date SDK unless the target needs to be remade. + # This covers use-cases such as running 'make check' after moving the build to a + # computer without Xcode or with a different Xcode version. + TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0) + ifeq ($(TARGET_UP_TO_DATE),0) + ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),) + $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.) + else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),) + $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.) + else ifneq ($(CURRENT_MAC_SDK_VERSION),) + $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).) + else + $(info Unknown error resolving current platform SDK version.) + endif + $(info This requires a fresh build. Please wipe the build directory completely,) + $(info including any .qmake.stash and .qmake.cache files generated by qmake.) + $(error ^) + endif + endif endif diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 8360dd8b38..50a41657d8 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -33,10 +33,6 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path) QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath) QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion) -sysrootified = -for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val -QMAKE_INCDIR_OPENGL = $$sysrootified - QMAKESPEC_NAME = $$basename(QMAKESPEC) # Resolve SDK version of various tools diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 5c7745e5bb..d075183028 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -38,7 +38,7 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:!no_moc_predefs:if(!macos|count(QMAKE_APP } else: error("Oops, I messed up") moc_predefs.output = $$MOC_DIR/moc_predefs.h moc_predefs.input = MOC_PREDEF_FILE - silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands + silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\\n\\t)@$$moc_predefs.commands QMAKE_EXTRA_COMPILERS += moc_predefs MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp } diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf index f81d1cece4..64faa4f215 100644 --- a/mkspecs/features/qmake_use.prf +++ b/mkspecs/features/qmake_use.prf @@ -1,24 +1,31 @@ suffix = for(ever) { - QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix}) + CC_USES = + LD_USES = for (use, QMAKE_USE$${suffix}) { use = $$split(use, /) name = $$take_first(use) - nu = $$upper($$name) + nu = $$upper($$replace(name, -, _)) + !contains(use, linkonly): CC_USES += $$nu + !contains(use, nolink): LD_USES += $$nu + } + CC_USES = $$resolve_depends(CC_USES, QMAKE_DEPENDS_, _CC) + for (nu, CC_USES) { + !defined(QMAKE_LIBS_$$nu, var): \ + error("Library '$$lower($$replace(nu, _, -))' is not defined.") + + DEFINES += $$eval(QMAKE_DEFINES_$${nu}) + INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu}) + } + LD_USES = $$resolve_depends(LD_USES, QMAKE_DEPENDS_, _LD) + for (nu, LD_USES) { !defined(QMAKE_LIBS_$$nu, var): \ - error("Library '$$name' is not defined.") + error("Library '$$lower($$replace(nu, _, -))' is not defined.") - !contains(use, nolink) { - QMAKE_LIBDIR += $$eval(QMAKE_LIBDIR_$$nu) - debug: \ - LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu) - else: \ - LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_RELEASE) $$eval(QMAKE_LIBS_$$nu) - } - !contains(use, linkonly) { - DEFINES += $$eval(QMAKE_DEFINES_$${nu}) - INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu}) - } + debug: \ + LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu) + else: \ + LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_RELEASE) $$eval(QMAKE_LIBS_$$nu) } !isEmpty(suffix): break() suffix = "_PRIVATE" diff --git a/mkspecs/features/qml1_module.prf b/mkspecs/features/qml1_module.prf deleted file mode 100644 index 33c3e44808..0000000000 --- a/mkspecs/features/qml1_module.prf +++ /dev/null @@ -1,13 +0,0 @@ -# -# W A R N I N G -# ------------- -# -# This file is not part of the Qt API. It exists purely as an -# implementation detail. It may change from version to version -# without notice, or even be removed. -# -# We mean it. -# - -CONFIG += qml1_target -load(qml_module) diff --git a/mkspecs/features/qml1_plugin.prf b/mkspecs/features/qml1_plugin.prf deleted file mode 100644 index cb1f0ce267..0000000000 --- a/mkspecs/features/qml1_plugin.prf +++ /dev/null @@ -1,13 +0,0 @@ -# -# W A R N I N G -# ------------- -# -# This file is not part of the Qt API. It exists purely as an -# implementation detail. It may change from version to version -# without notice, or even be removed. -# -# We mean it. -# - -CONFIG += qml1_target -load(qml_plugin) diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf index 65212b2abf..dbf5b74355 100644 --- a/mkspecs/features/qml_module.prf +++ b/mkspecs/features/qml_module.prf @@ -13,7 +13,14 @@ equals(TEMPLATE, app): TEMPLATE = aux isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)") -qmldir_file = $$_PRO_FILE_PWD_/qmldir +!isEmpty(DYNAMIC_QMLDIR) { + qmldir_path = $$OUT_PWD + write_file($${qmldir_path}/qmldir, DYNAMIC_QMLDIR)|error("Aborting.") +} else { + qmldir_path = $$_PRO_FILE_PWD_ +} + +qmldir_file = $${qmldir_path}/qmldir fq_qml_files = for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_) @@ -23,15 +30,9 @@ for(qmlf, AUX_QML_FILES): fq_aux_qml_files += $$absolute_path($$qmlf, $$_PRO_FIL load(qt_build_paths) -qml1_target { - DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH - instbase = $$[QT_INSTALL_IMPORTS] -} else { - DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH - instbase = $$[QT_INSTALL_QML] -} +DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH -!qml1_target:static: \ +static: \ CONFIG += builtin_resources else: \ CONFIG += install_qml_files @@ -48,13 +49,20 @@ builtin_resources { } # Install rules -qmldir.base = $$_PRO_FILE_PWD_ +qmldir.base = $$qmldir_path # Tools need qmldir and plugins.qmltypes always installed on the file system -qmldir.files = $$qmldir_file $$fq_aux_qml_files + +qmldir.files = $$qmldir_file install_qml_files: qmldir.files += $$fq_qml_files -qmldir.path = $$instbase/$$TARGETPATH +qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH INSTALLS += qmldir +qmlfiles.base = $$_PRO_FILE_PWD_ +qmlfiles.files = $$fq_aux_qml_files +install_qml_files: qmlfiles.files += $$fq_qml_files +qmlfiles.path = $${qmldir.path} +INSTALLS += qmlfiles + !debug_and_release|!build_all|CONFIG(release, debug|release) { !prefix_build { COPIES += qmldir diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index 0786dbfd84..02068ae766 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -48,15 +48,9 @@ exists($$QMLTYPEFILE): AUX_QML_FILES += $$QMLTYPEFILE load(qt_build_paths) -qml1_target { - DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH - instbase = $$[QT_INSTALL_IMPORTS] -} else { - DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH - instbase = $$[QT_INSTALL_QML] -} +DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH -target.path = $$instbase/$$TARGETPATH +target.path = $$[QT_INSTALL_QML]/$$TARGETPATH INSTALLS += target # Some final setup @@ -75,20 +69,11 @@ load(qt_common) # directory. Then review and commit the changes made to plugins.qmltypes. # !cross_compile { - qml1_target { - qmlplugindump = qml1plugindump - importpath.name = QML_IMPORT_PATH - } else { - qmlplugindump = qmlplugindump - importpath.name = QML2_IMPORT_PATH - } + qmlplugindump = qmlplugindump + importpath.name = QML2_IMPORT_PATH importpath.value = for(qmod, QTREPOS) { - qml1_target: \ - qmod = $$qmod/imports - else: \ - qmod = $$qmod/qml - exists($$qmod): importpath.value += $$shell_path($$qmod) + exists($$qmod/qml): importpath.value += $$shell_path($$qmod/qml) } importpath.value = $$unique(importpath.value) QT_TOOL_ENV = importpath @@ -109,9 +94,17 @@ load(qt_common) } load(resolve_target) - TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) + isEmpty(IMPORT_NAME): IMPORT_NAME = $$replace(TARGETPATH, \\.\\d+\$, ) + + !qml1_target { + isEmpty(QMAKE_PLUGINDUMP_DEPENDENCIES_FILE):exists($$_PRO_FILE_PWD_/dependencies.json): \ + QMAKE_PLUGINDUMP_DEPENDENCIES_FILE = $$_PRO_FILE_PWD_/dependencies.json + !isEmpty(QMAKE_PLUGINDUMP_DEPENDENCIES_FILE): \ + QMAKE_QMLPLUGINDUMP_FLAGS += -dependencies $$shell_quote($$QMAKE_PLUGINDUMP_DEPENDENCIES_FILE) + } + qmltypes.target = qmltypes - qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE + qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(IMPORT_NAME, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE qmltypes.depends = $$QMAKE_RESOLVED_TARGET } else { qmltypes.CONFIG += recursive diff --git a/mkspecs/features/qmltestcase.prf b/mkspecs/features/qmltestcase.prf index 216f37d61a..b4b1224781 100644 --- a/mkspecs/features/qmltestcase.prf +++ b/mkspecs/features/qmltestcase.prf @@ -1,7 +1,8 @@ !isEmpty(SOURCES) { QT += qml qmltest load(testcase) - DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\" + contains(TEMPLATE, vc.*): DEFINES += QUICK_TEST_SOURCE_DIR=\"$$_PRO_FILE_PWD_\" + else: DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"$$_PRO_FILE_PWD_\") } else { # Allow a project to run tests without a CPP stub TEMPLATE = aux diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 90e318e2a4..5ac640190a 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -2,7 +2,7 @@ # due to required Qt modules being missing. !isEmpty(QMAKE_FAILED_REQUIREMENTS): return() -CONFIG *= thread +qtConfig(thread): CONFIG *= thread #handle defines win32 { @@ -198,28 +198,6 @@ for(ever) { MODULE_LIBS_ADD = $$MODULE_LIBS MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS - !contains(MODULE_CONFIG, v2) { - # Backwards compatibility with pre-5.6 module .pri files - - contains(MODULE_CONFIG, lib_bundle) { - MODULE_FRAMEWORKS = $$MODULE_LIBS - inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers - MODULE_INCLUDES = $$inc - contains(MODULE_CONFIG, internal_module): \ - MODULE_INCLUDES += \ - $$inc/$$eval(QT.$${QTLIB}.VERSION) \ - $$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME - } else { - # Re-insert the major version in the library name (cf qt5LibraryTarget above) - MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION, - } - - # Only link to this module if a libs directory is set, else this is just a module - # to give access to sources or include files, and not for linking. - !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \ - MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX} - } - # Frameworks shouldn't need include paths, but much code does not use # module-qualified #includes, so by default we add paths which point # directly into the frameworks. Private modules have somewhat convoluted @@ -231,14 +209,6 @@ for(ever) { !isEmpty(MODULE_MODULE) { contains(MODULE_CONFIG, lib_bundle) { framework = $$MODULE_MODULE - qtConfig(debug_and_release):!macx-xcode { - platform_target_suffix = $$qtPlatformTargetSuffix() - !isEmpty(platform_target_suffix): \ - # The -framework linker argument supports a name[,suffix] version, - # where if the suffix is specified the framework is first searched - # for the library with the suffix and then without. - framework = $$framework,$$platform_target_suffix - } LIBS$$var_sfx += -framework $$framework } else { !isEmpty(MODULE_LIBS_ADD): \ diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index 4ad9946ae0..ae859a81ff 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -89,6 +89,14 @@ clang { greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wshift-overflow=2 -Wduplicated-cond # GCC 7 has a lot of false positives relating to this, so disable completely greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow + # GCC 9 has a lot of false positives relating to this, so disable completely + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime } warnings_are_errors:warning_clean { @@ -97,23 +105,24 @@ warnings_are_errors:warning_clean { # compiler. clang { # Apple clang 4.0-4.2,5.0-5.1,6.0-6.4,7.0-7.3,8.0-8.3,9.0-9.2 - # Regular clang 3.x-6.0 + # Regular clang 3.x-7.0 apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION} reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION} - contains(apple_ver, "4\\.[012]|5\\.[01]|6\\.[01234]|7\\.[0123]|8\\.[0123]|9\\.[012]")|contains(reg_ver, "[345]\\.|6\\.0") { + contains(apple_ver, "4\\.[012]|5\\.[01]|6\\.[01234]|7\\.[0123]|8\\.[0123]|9\\.[012]")|contains(reg_ver, "[345]\\.|[67]\\.0") { QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR } } else:intel_icc:linux { - # Intel CC 13.0 - 17.0, on Linux only + # Intel CC 13.0 - 18.0, on Linux only ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION} - linux:contains(ver, "(1[3456]\\.|17\\.0)") { + linux:contains(ver, "(1[345678]\\.|19\\.0)") { # 177: function "entity" was declared but never referenced # (too aggressive; ICC reports even for functions created due to template instantiation) # 1224: #warning directive # 1478: function "entity" (declared at line N) was declared deprecated + # 1786: function "entity" (declared at line N of "file") was declared deprecated ("message") # 1881: argument must be a constant null pointer value # (NULL in C++ is usually a literal 0) - QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR + QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1786,1881 $$WERROR } } else:gcc:!clang:!intel_icc:!rim_qcc { # GCC 4.6-4.9, 5.x, ... @@ -127,7 +136,14 @@ warnings_are_errors:warning_clean { # GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs. greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=implicit-fallthrough - + # GCC 9 has a lot of false positives relating to this, so disable completely + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135 android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix } diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 81b820978a..168a8e64f2 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1,3 +1,13 @@ +# +# W A R N I N G +# ------------- +# +# This file is not part of the Qt API. It exists purely as an +# implementation detail. It may change from version to version +# without notice, or even be removed. +# +# We mean it. +# QT_CONFIGURE_REPORT = QT_CONFIGURE_NOTES = @@ -51,6 +61,13 @@ defineTest(qtConfCommandlineSetInput) { val = $${2} !isEmpty($${currentConfig}.commandline.options.$${arg}.name): \ arg = $$eval($${currentConfig}.commandline.options.$${arg}.name) + !isEmpty(config.input.$$arg) { + oldval = $$eval(config.input.$$arg) + equals(oldval, $$val): \ + qtConfAddNote("Option '$$arg' with value '$$val' was specified twice") + else: \ + qtConfAddNote("Overriding option '$$arg' with '$$val' (was: '$$oldval')") + } config.input.$$arg = $$val export(config.input.$$arg) @@ -323,9 +340,21 @@ defineTest(qtConfParseCommandLine) { type = boolean } + isEmpty(type):contains(opt, "skip") { + isEmpty(skipOptionWarningAdded) { + qtConfAddWarning("Command line option -skip is only effective in top-level builds.") + skipOptionWarningAdded = 1 + } + val = $$qtConfGetNextCommandlineArg() + next() + } + isEmpty(type) { qtConfAddError("Unknown command line option '$$c'.") - return() + equals(config.input.continue, yes): \ + next() + else: \ + return() } call = "qtConfCommandline_$${type}" @@ -358,22 +387,31 @@ defineTest(qtConfTest_compilerSupportsFlag) { defineTest(qtConfTest_linkerSupportsFlag) { flag = $$eval($${1}.flag) + use_bfd_linker: \ + LFLAGS = -fuse-ld=bfd use_gold_linker: \ LFLAGS = -fuse-ld=gold + use_lld_linker: \ + LFLAGS = -fuse-ld=lld return($$qtConfToolchainSupportsFlag($$LFLAGS "-Wl,$$flag")) } defineReplace(qtConfFindInPathList) { + # This nesting is consistent with Apple ld -search_paths_first, + # and presumably with GNU ld (no actual documentation found). for (dir, 2) { - exists("$$dir/$${1}"): \ - return("$$dir/$${1}") + for (file, 1) { + exists("$$dir/$$file"): \ + return("$$dir/$$file") + } } return() } defineReplace(qtConfFindInPath) { ensurePathEnv() + equals(QMAKE_HOST.os, Windows):!contains(1, .*\\.exe): 1 = $${1}.exe return($$qtConfFindInPathList($$1, $$2 $$QMAKE_PATH_ENV)) } @@ -424,12 +462,12 @@ defineTest(qtConfSetupLibraries) { lpfx = $${currentConfig}.libraries.$${l} # 'export' may be omitted, in which case it falls back to the library's name !defined($${lpfx}.export, var) { - $${lpfx}.export = $$l + $${lpfx}.export = $$replace(l, -, _) export($${lpfx}.export) } # 'export' may also be empty, but we need a derived identifier alias = $$eval($${lpfx}.export) - isEmpty(alias): alias = $$l + isEmpty(alias): alias = $$replace(l, -, _) $${lpfx}.alias = $$alias export($${lpfx}.alias) # make it easy to refer to the library by its export name. @@ -488,6 +526,175 @@ defineTest(qtConfSetupLibraries) { } } +# libs-var, libs, in-paths, out-paths-var +defineTest(qtConfResolveLibs) { + ret = true + paths = $$3 + out = + copy = false + for (l, 2) { + $$copy { + copy = false + out += $$l + } else: equals(l, "-s") { + # em++ flag to link libraries from emscripten-ports; passed on literally. + copy = true + out += $$l + } else: contains(l, "^-L.*") { + lp = $$replace(l, "^-L", ) + !exists($$lp/.) { + qtLog("Library path $$val_escape(lp) is invalid.") + ret = false + } else { + paths += $$lp + } + } else: contains(l, "^-l.*") { + lib = $$replace(l, "^-l", ) + lcan = + integrity:contains(lib, "^.*\\.a") { + # INTEGRITY compiler searches for exact filename + # if -l argument has .a suffix + lcan += $${lib} + } else: contains(lib, "^:.*") { + # Use exact filename when -l:filename syntax is used. + lib ~= s/^:// + lcan += $${lib} + } else: unix { + # Under UNIX, we look for actual shared libraries, in addition + # to static ones. + shexts = $$QMAKE_EXTENSION_SHLIB $$QMAKE_EXTENSIONS_AUX_SHLIB + for (ext, shexts) { + lcan += $${QMAKE_PREFIX_SHLIB}$${lib}.$${ext} + } + lcan += \ + $${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB} + } else { + # Under Windows, we look only for static libraries, as even for DLLs + # one actually links against a static import library. + mingw { + lcan += \ + # MinGW supports UNIX-style library naming in addition to + # the MSVC style. + lib$${lib}.dll.a lib$${lib}.a \ + # Fun fact: prefix-less libraries are also supported. + $${lib}.dll.a $${lib}.a + } + lcan += $${lib}.lib + } + l = $$qtConfFindInPathList($$lcan, $$paths $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS) + isEmpty(l) { + qtLog("None of [$$val_escape(lcan)] found in [$$val_escape(paths)] and global paths.") + ret = false + } else { + out += $$l + } + } else { + out += $$l + } + } + $$1 = $$out + export($$1) + !isEmpty(4) { + $$4 = $$paths + export($$4) + } + return($$ret) +} + +# source-var +defineTest(qtConfResolveAllLibs) { + ret = true + !qtConfResolveLibs($${1}.libs, $$eval($${1}.libs), , $${1}.libdirs): \ + ret = false + for (b, $${1}.builds._KEYS_): \ + !qtConfResolveLibs($${1}.builds.$${b}, $$eval($${1}.builds.$${b}), $$eval($${1}.libdirs), ): \ + ret = false + return($$ret) +} + +# libs-var, in-paths, libs +defineTest(qtConfResolvePathLibs) { + ret = true + for (libdir, 2) { + !exists($$libdir/.) { + qtLog("Library path $$val_escape(libdir) is invalid.") + ret = false + } + } + !qtConfResolveLibs($$1, $$3, $$2): \ + ret = false + return($$ret) +} + +defineReplace(qtConfGetTestSourceList) { + result = + !isEmpty($${1}.test.inherit) { + base = $$section(1, ., 0, -2) + for (i, $${1}.test.inherit): \ + result += $$qtConfGetTestSourceList($${base}.$$i) + } + return($$result $$1) +} + +defineReplace(qtConfGetTestIncludes) { + defined($${1}._KEYS_, var) { + 1st = $$first($${1}._KEYS_) + equals(1st, 0) { + # array; recurse for every element + ret = + for (k, $${1}._KEYS_): \ + ret += $$qtConfGetTestIncludes($${1}.$$k) + return($$ret) + } + # object; try condition and recurse + !defined($${1}.headers, var):!defined($${1}.headers._KEYS_, var): \ # just plain broken without it + error("headers object '$$1' has no nested headers entry") + cond = $$eval($${1}.condition) + isEmpty(cond): \ # would be pointless otherwise + error("headers object '$$1' has no condition") + !$$qtConfEvaluate($$cond) { + qtLog("header entry '$$1' failed condition '$$cond'.") + return() + } + qtLog("header entry '$$1' passed condition.") + return($$qtConfGetTestIncludes($${1}.headers)) + } + return($$eval($$1)) # plain string - or nothing (can happen for top-level call only) +} + +# includes-var, in-paths, test-object-var +defineTest(qtConfResolvePathIncs) { + ret = true + for (incdir, 2) { + !exists($$incdir/.) { + qtLog("Include path $$val_escape(incdir) is invalid.") + ret = false + } + } + 2 -= $$QMAKE_DEFAULT_INCDIRS + $$1 = $$2 + export($$1) + wasm { + # FIXME: emcc downloads pre-built libraries and adds their include + # path to the clang call dynamically. it would be possible to parse + # the emcc -s USE_xyz=1 --cflags output to populate xzy_INCDIR and + # thus make the code below work. + return($$ret) + } + tests = $$qtConfGetTestSourceList($$3) + hdrs = + for (test, tests): \ + hdrs += $$qtConfGetTestIncludes($${test}.headers) + for (hdr, hdrs) { + h = $$qtConfFindInPathList($$hdr, $$2 $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) + isEmpty(h) { + qtLog("$$hdr not found in [$$val_escape(2)] and global paths.") + ret = false + } + } + return($$ret) +} + # the library is specified inline in a 'libs' field. # overrides from the command line are accepted. defineTest(qtConfLibrary_inline) { @@ -517,7 +724,6 @@ defineTest(qtConfLibrary_inline) { vars += $$eval(config.commandline.rev_assignments.$${iv}) defined(config.input.$${iv}, var) { eval($${1}.builds.$${b} = $$eval(config.input.$${iv})) - export($${1}.builds.$${b}) $${1}.builds._KEYS_ *= $${b} any = true } else { @@ -532,36 +738,35 @@ defineTest(qtConfLibrary_inline) { export($${1}.builds._KEYS_) # we also reset the generic libs, to avoid surprises. $${1}.libs = - export($${1}.libs) } # direct libs. overwrites inline libs. - defined(config.input.$${input}.libs, var) { + defined(config.input.$${input}.libs, var): \ eval($${1}.libs = $$eval(config.input.$${input}.libs)) - export($${1}.libs) - } + + includes = $$eval(config.input.$${input}.incdir) # prefix. prepends to (possibly overwritten) inline libs. prefix = $$eval(config.input.$${input}.prefix) !isEmpty(prefix) { - $${1}.includedir = $$prefix/include - export($${1}.includedir) + includes += $$prefix/include $${1}.libs = -L$$prefix/lib $$eval($${1}.libs) - export($${1}.libs) - } - - incdir = $$eval(config.input.$${input}.incdir) - !isEmpty(incdir) { - $${1}.includedir = $$incdir - export($${1}.includedir) } libdir = $$eval(config.input.$${input}.libdir) !isEmpty(libdir) { - $${1}.libs = -L$$libdir $$eval($${1}.libs) - export($${1}.libs) + libs = + for (ld, libdir): \ + libs += -L$$ld + $${1}.libs = $$libs $$eval($${1}.libs) } + !qtConfResolveAllLibs($$1): \ + return(false) + + !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \ + return(false) + return(true) } @@ -572,17 +777,13 @@ defineTest(qtConfLibrary_makeSpec) { isEmpty(spec): \ error("makeSpec source in library '$$eval($${1}.library)' does not specify 'spec'.") - $${1}.includedir = $$eval(QMAKE_INCDIR_$$spec) - export($${1}.includedir) - $${1}.libs = - for (l, QMAKE_LIBDIR_$$spec): \ - $${1}.libs += -L$$l - $${1}.libs += $$eval(QMAKE_LIBS_$$spec) - export($${1}.libs) + !qtConfResolvePathLibs($${1}.libs, $$eval(QMAKE_LIBDIR_$$spec), $$eval(QMAKE_LIBS_$$spec)): \ + return(false) - # the library definition is always in scope, so no point in exporting it. - $${1}.export = false - export($${1}.export) + !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec), $$2): \ + return(false) + + # note that the object is re-exported, because we resolve the libraries. return(true) } @@ -602,13 +803,22 @@ defineTest(qtConfLibrary_pkgConfig) { } qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false) - qtRunLoggedCommand("$$pkg_config --libs-only-L $$args", libpaths)|return(false) - qtRunLoggedCommand("$$pkg_config --libs-only-l $$args", libs)|return(false) version ~= s/[^0-9.].*$// $${1}.version = $$first(version) export($${1}.version) - eval($${1}.libs = $$libpaths $$libs) - export($${1}.libs) + + qtRunLoggedCommand("$$pkg_config --libs-only-L $$args", libpaths)|return(false) + qtRunLoggedCommand("$$pkg_config --libs-only-l $$args", libs)|return(false) + eval(libs = $$libpaths $$libs) + !qtConfResolveLibs($${1}.libs, $$libs): \ + return(false) + contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") { + qtRunLoggedCommand("$$pkg_config --static --libs-only-L $$args", libpaths)|return(false) + qtRunLoggedCommand("$$pkg_config --static --libs-only-l $$args", libs)|return(false) + eval(libs = $$libpaths $$libs) + !qtConfResolveLibs($${1}.libs, $$libs): \ + return(false) + } qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false) # Split CFLAGS into stuff that goes into DEFINES, INCLUDEPATH, and other stuff. @@ -633,10 +843,26 @@ defineTest(qtConfLibrary_pkgConfig) { } !isEmpty(ignored): \ qtLog("Note: Dropped compiler flags '$$ignored'.") + !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \ + return(false) $${1}.defines = $$defines - export($${1}.defines) - $${1}.includedir = $$includes + + # now remove the content of the transitive deps we know about. + largs = $$qtConfAllLibraryArgs($$eval($${2}.dependencies)) + for (la, largs): \ + eval("$$la") + USES = $$eval($$list($$upper($$replace(QMAKE_USE, -, _)))) + # _CC == _LD for configure's library sources, so pick first arbitrarily. + DEPS = $$resolve_depends(USES, QMAKE_DEPENDS_, _CC) + for (DEP, DEPS) { + $${1}.libs -= $$eval(QMAKE_LIBS_$${DEP}) + $${1}.includedir -= $$eval(QMAKE_INCDIR_$${DEP}) + $${1}.defines -= $$eval(QMAKE_DEFINES_$${DEP}) + } + export($${1}.libs) export($${1}.includedir) + export($${1}.defines) + return(true) } @@ -658,7 +884,7 @@ defineTest(qtConfTest_getPkgConfigVariable) { } defineReplace(qtConfLibraryArgs) { - NAME = $$upper($$eval($${1}.library)) + NAME = $$upper($$replace($${1}.library, -, _)) qmake_args = "QMAKE_LIBS_$${NAME} = $$val_escape($${1}.libs)" for (b, $${1}.builds._KEYS_): \ qmake_args += "QMAKE_LIBS_$${NAME}_$$upper($$b) = $$val_escape($${1}.builds.$${b})" @@ -668,20 +894,36 @@ defineReplace(qtConfLibraryArgs) { defines = $$eval($${1}.defines) !isEmpty(defines): \ qmake_args += "QMAKE_DEFINES_$${NAME} = $$val_escape(defines)" + depends = $$eval($${2}.dependencies) + !isEmpty(depends) { + dep_uses = + for (use, depends): \ + dep_uses += $$section(use, :, 1, 1) + qmake_args += \ + "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$replace(dep_uses, -, _))" \ + "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$replace(dep_uses, -, _))" + } return($$qmake_args) } defineReplace(qtConfAllLibraryArgs) { isEmpty(1): return() dep_uses = + for (use, 1): \ + dep_uses += $$section(use, :, 1, 1) dep_args = - for (use, 1) { + seen = + for(ever) { + isEmpty(1): break() + use = $$take_last(1) + contains(seen, $$use): next() + seen += $$use use_cfg = $$section(use, :, 0, 0) - use_lib = $$section(use, :, 1, 1) - dep_uses += $$use_lib !isEmpty(use_cfg) { + use_lib = $$section(use, :, 1, 1) lpfx = $${use_cfg}.libraries.$$use_lib - dep_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source)) + dep_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source), $$lpfx) + 1 += $$eval($${lpfx}.dependencies) } } return("QMAKE_USE += $$dep_uses" $$dep_args) @@ -710,6 +952,24 @@ defineTest(qtConfExportLibrary) { !isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines) includes = $$eval($${spfx}.includedir) !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes) + uses = $$eval($${lpfx}.dependencies) + !isEmpty(uses) { + # FIXME: ideally, we would export transitive deps only for static + # libs, to not extend the link interface unduly. however, the system + # does currently not differentiate between public and private deps. + depends = + for (use, uses) { + use_cfg = $$section(use, :, 0, 0) + use_lib = $$section(use, :, 1, 1) + !isEmpty(use_cfg): \ + depends += $$upper($$eval($${use_cfg}.libraries.$${use_lib}.export)) + else: \ + depends += $$upper($$replace(use_lib, -, _)) + } + # we use suffixes instead of infixes, because $$resolve_depends() demands it. + qtConfOutputVar(assign, $$output, QMAKE_DEPENDS_$${NAME}_CC, $$depends) + qtConfOutputVar(assign, $$output, QMAKE_DEPENDS_$${NAME}_LD, $$depends) + } !isEmpty($${currentConfig}.module): \ qtConfExtendVar($$output, "QT.$${currentModule}_private.libraries", $$name) } @@ -735,7 +995,8 @@ defineTest(qtConfHandleLibrary) { export($${lpfx}.result) return() } - resolved_uses = $$eval($${lpfx}.resolved_uses) + $${lpfx}.dependencies = $$eval($${lpfx}.resolved_uses) + export($${lpfx}.dependencies) qtConfLoadResult($${lpfx}, $$1, "library") { $$eval($${lpfx}.result): \ @@ -772,8 +1033,8 @@ defineTest(qtConfHandleLibrary) { export($${lpfx}.source) # if the library defines a test, use it to verify the source. - !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) { - $${lpfx}.resolved_uses = $$currentConfig:$$1 $$resolved_uses + defined($${lpfx}.test, var)|defined($${lpfx}.test._KEYS_, var) { + $${lpfx}.resolved_uses = $$currentConfig:$$1 $${lpfx}.host = $$eval($${spfx}.host) !qtConfTest_compile($$lpfx) { qtLog(" => source failed verification.") @@ -878,7 +1139,7 @@ defineTest(qtConfTestPrepare_compile) { } } isEmpty(libConfig) { - nu = $$upper($$u) + nu = $$upper($$replace(u, -, _)) !defined(QMAKE_LIBS_$$nu, var): \ error("Test $$1 tries to use undeclared library '$$u'") # using an external library by exported name. @@ -897,8 +1158,12 @@ defineTest(qtConfTestPrepare_compile) { defineTest(qtConfPrepareCompileTestSource) { test_dir = $$2 - test_lang = $$eval($${1}.lang) - isEmpty(test_lang): test_lang = "c++" + tests = $$qtConfGetTestSourceList($$1) + + test_lang = "c++" + for (test, tests): \ + test_lang += $$eval($${test}.test.lang) + test_lang = $$last(test_lang) # Last non-empty, that is. equals(test_lang, "c++"): suffix = "cpp" else: equals(test_lang, "c"): suffix = "c" @@ -909,33 +1174,48 @@ defineTest(qtConfPrepareCompileTestSource) { # Create source code contents = "/* Generated by configure */" # Custom code before includes - for (ent, $$qtConfScalarOrList($${1}.head)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.head)): \ + contents += $$ent # Includes - for (ent, $$qtConfScalarOrList($${1}.include)): \ - contents += "$${LITERAL_HASH}include <$$ent>" + for (test, tests) { + hdrs = $$qtConfGetTestIncludes($${test}.test.include) + isEmpty(hdrs): \ + hdrs = $$qtConfGetTestIncludes($${test}.headers) + for (ent, hdrs): \ + contents += "$${LITERAL_HASH}include <$$ent>" + } # Custom code after includes - for (ent, $$qtConfScalarOrList($${1}.tail)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.tail)): \ + contents += $$ent # And finally the custom code inside main() contents += \ "int main(int argc, char **argv)" \ "{" \ " (void)argc; (void)argv;" \ " /* BEGIN TEST: */" - for (ent, $$qtConfScalarOrList($${1}.main)): \ - contents += " $$ent" + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.main)): \ + contents += " $$ent" contents += \ " /* END TEST */" \ " return 0;" \ "}" write_file($$test_dir/main.$$suffix, contents)|error() + for (test, tests) { + for (file, $$qtConfScalarOrList($${test}.test.files._KEYS_)): \ + write_file($$test_dir/$$file, $$qtConfScalarOrList($${test}.test.files.$${file}))|error() + } + # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code - for (ent, $$qtConfScalarOrList($${1}.qmake)): \ - contents += $$ent + pwd = $$val_escape($${currentConfig}.dir) + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.qmake)): \ + contents += $$replace(ent, "@PWD@", $$pwd) write_file($$test_dir/$$basename(test_dir).pro, contents)|error() } @@ -948,7 +1228,7 @@ defineTest(qtConfTest_compile) { isEmpty(test) { test_dir = $$test_base_out_dir/$$section(1, ".", -1) test_out_dir = $$test_dir - qtConfPrepareCompileTestSource($${1}.test, $$test_dir) + qtConfPrepareCompileTestSource($$1, $$test_dir) } else { test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_out_dir = $$test_base_out_dir/$$test @@ -971,8 +1251,12 @@ defineTest(qtConfTest_compile) { else: \ qmake_configs = "static" + use_bfd_linker: \ + qmake_configs += "use_bfd_linker" use_gold_linker: \ qmake_configs += "use_gold_linker" + use_lld_linker: \ + qmake_configs += "use_lld_linker" # disable warnings from the builds, since they're just noise at this point. qmake_configs += "warn_off" @@ -1038,9 +1322,9 @@ defineTest(qtConfTest_files) { for(i, $${1}.files._KEYS_) { f = $$eval($${1}.files.$${i}) qtLog("Searching for file $${f}.") - contains(f, ".*\.h") { + contains(f, ".*\\.h") { file = $$qtConfFindInPathList($$f, $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) - } else: contains(f, ".*\.(lib|so|a)") { + } else: contains(f, ".*\\.(lib|so|a)") { file = $$qtConfFindInPathList($$f, $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS) } else { # assume we're looking for an executable @@ -1156,7 +1440,7 @@ defineTest(qtConfSetupTestTypeDeps) { } } -defineTest(qtConfEnsureTestTypeDeps) { +defineTest(qtConfEnsureTestTypeDepsOne) { depsn = $${currentConfig}.testTypeDependencies.$${1}._KEYS_ !isEmpty($$depsn) { for (dep, $$depsn) { @@ -1170,12 +1454,18 @@ defineTest(qtConfEnsureTestTypeDeps) { fwdsn = $${currentConfig}.testTypeForwards.$${1} !isEmpty($$fwdsn) { for (fwd, $$fwdsn): \ - qtConfEnsureTestTypeDeps($$fwd) + qtConfEnsureTestTypeDepsOne($$fwd) $$fwdsn = export($$fwdsn) } } +defineTest(qtConfEnsureTestTypeDeps) { + qtConfEnsureTestTypeDepsOne($$1) + currentConfig = config.builtins + qtConfEnsureTestTypeDepsOne($$1) +} + defineTest(qtRunSingleTest) { tpfx = $${currentConfig}.tests.$${1} defined($${tpfx}.result, var): \ @@ -1235,7 +1525,7 @@ defineReplace(qtConfEvaluate) { 1 ~= s/$$escape_expand(\\n) */ /g expr = $${1} expr ~= s/&&/ && /g - expr ~= s/\|\|/ || /g + expr ~= s/\\|\\|/ || /g expr ~= s/!/ ! /g expr ~= s/\\(/ ( /g expr ~= s/\\)/ ) /g @@ -1258,7 +1548,7 @@ defineReplace(qtConfEvaluateSingleExpression) { } else: contains(e, "^'.*'$") { # quoted literals result = $$replace(e, "^'(.*)'$", "\\1") - } else: contains(e, "^tests\..*") { + } else: contains(e, "^tests\\..*") { !qt_conf_tests_allowed: \ error("Expression '$${1}' refers to a test, which is not allowed at this stage of configuring.") test = $$section(e, ".", 1, 1) @@ -1269,7 +1559,7 @@ defineReplace(qtConfEvaluateSingleExpression) { error("Unknown test object $${test} in expression '$${1}'.") qtRunSingleTest($$test) result = $$eval($${currentConfig}.tests.$${test}.$${var}) - } else: contains(e, "^libs\..*") { + } else: contains(e, "^libs\\..*") { !qt_conf_tests_allowed: \ error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.") lib = $$section(e, ".", 1, 1) @@ -1282,7 +1572,7 @@ defineReplace(qtConfEvaluateSingleExpression) { !defined($${currentConfig}.libraries.$${lib}.$${var}, var): \ var = sources.$$eval($${currentConfig}.libraries.$${lib}.source).$$var result = $$eval($${currentConfig}.libraries.$${lib}.$${var}) - } else: contains(e, "^features\..*") { + } else: contains(e, "^features\\..*") { feature = $$section(e, ".", 1, 1) var = $$section(e, ".", 2, -1) isEmpty(var): \ @@ -1306,33 +1596,33 @@ defineReplace(qtConfEvaluateSingleExpression) { !qtConfCheckFeature($$feature): \ error("Expression '$$1' is accessing non-emitted feature $${feature}.") result = $$eval($${currentConfig}.features.$${feature}.$${var}) - } else: contains(e, "^config\..*") { - var = $$replace(e, "^config\.", "") + } else: contains(e, "^config\\..*") { + var = $$replace(e, "^config\\.", "") result = false contains(CONFIG, $$var): result = true - } else: contains(e, "^module\..*") { - var = $$replace(e, "^module\.", "") + } else: contains(e, "^module\\..*") { + var = $$replace(e, "^module\\.", "") result = false qtConfHaveModule($$var): result = true - } else: contains(e, "^arch\..*") { - var = $$replace(e, "^arch\.", "") + } else: contains(e, "^arch\\..*") { + var = $$replace(e, "^arch\\.", "") result = false isEmpty(QT_ARCH): \ qtConfCheckFeature(architecture) contains(QT_ARCH, $$var): result = true - } else: contains(e, "^subarch\..*") { - var = $$replace(e, "^subarch\.", "") + } else: contains(e, "^subarch\\..*") { + var = $$replace(e, "^subarch\\.", "") result = false isEmpty(QT_ARCH): \ qtConfCheckFeature(architecture) contains(QT_CPU_FEATURES.$$QT_ARCH, $$var): result = true - } else: contains(e, "^input\..*") { + } else: contains(e, "^input\\..*") { result = $$eval(config.$$e) - } else: contains(e, "^var\..*") { - var = $$replace(e, "^var\.", "") + } else: contains(e, "^var\\..*") { + var = $$replace(e, "^var\\.", "") result = $$eval($$var) - } else: contains(e, "^call\..*") { - call = $$replace(e, "^call\.", "qtConfFunc_") + } else: contains(e, "^call\\..*") { + call = $$replace(e, "^call\\.", "qtConfFunc_") !defined($$call, replace): \ error("Call $$call referenced in expression '$${1}' does not exist") eval(result = \$\$"$$call"()) @@ -1660,6 +1950,11 @@ defineTest(qtConfCheckErrors) { # output generation # +defineTest(qtConfOutput_libraryPaths) { + qtLog("Global lib dirs: [$$val_escape(EXTRA_LIBDIR)] [$$val_escape(QMAKE_DEFAULT_LIBDIRS)]") + qtLog("Global inc dirs: [$$val_escape(EXTRA_INCLUDEPATH)] [$$val_escape(QMAKE_DEFAULT_INCDIRS)]") +} + # qtConfOutputVar(modifier, output, name, value) defineTest(qtConfOutputVar) { modifier = $$1 @@ -2028,6 +2323,9 @@ for(ever) { } configsToProcess = $$subconfigs $$configsToProcess } +# 'builtins' is used for command line parsing and test type dependency +# injection, but its features must not be processed regularly. +allModuleConfigs = $$member(allConfigs, 1, -1) QMAKE_SAVED_ARGS = $$QMAKE_EXTRA_ARGS QMAKE_REDO_CONFIG = false @@ -2036,7 +2334,7 @@ qtConfCheckErrors() !isEmpty(config.input.list-features) { all_ft = - for (currentConfig, allConfigs) { + for (currentConfig, allModuleConfigs) { for (k, $${currentConfig}.features._KEYS_) { pp = $$eval($${currentConfig}.features.$${k}.purpose) !isEmpty(pp) { @@ -2056,7 +2354,7 @@ qtConfCheckErrors() !isEmpty(config.input.list-libraries) { logn() - for (currentConfig, allConfigs) { + for (currentConfig, allModuleConfigs) { !isEmpty($${currentConfig}.exports._KEYS_) { !isEmpty($${currentConfig}.module): \ logn($$eval($${currentConfig}.module):) @@ -2093,7 +2391,7 @@ qtLog("Command line: $$qtSystemQuote($$QMAKE_SAVED_ARGS)") $$QMAKE_REDO_CONFIG: \ qtLog("config.opt: $$qtSystemQuote($$QMAKE_EXTRA_REDO_ARGS)") -for (currentConfig, allConfigs) { +for (currentConfig, allModuleConfigs) { qtConfSetModuleName() qtConfSetupModuleOutputs() # do early checks, mainly to validate the command line @@ -2137,7 +2435,7 @@ CONFIG += qt_conf_tests_allowed logn() logn("Running configuration tests...") -for (currentConfig, allConfigs) { +for (currentConfig, allModuleConfigs) { tdir = $$eval($${currentConfig}.testDir) isEmpty(tdir): tdir = config.tests QMAKE_CONFIG_TESTS_DIR = $$absolute_path($$tdir, $$eval($${currentConfig}.dir)) @@ -2201,7 +2499,7 @@ qtConfPrintReport() logn() logn("Qt is now configured for building. Just run '$$QMAKE_MAKE_NAME'.") pfx = $$[QT_INSTALL_PREFIX] -equals(pfx, $$[QT_INSTALL_PREFIX/get]) { +exists($$pfx/.qmake.cache) { logn("Once everything is built, Qt is installed.") logn("You should NOT run '$$QMAKE_MAKE_NAME install'.") logn("Note that this build cannot be deployed to other machines or devices.") diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf index 3139c443c6..3b74cd4dd5 100644 --- a/mkspecs/features/qt_docs.prf +++ b/mkspecs/features/qt_docs.prf @@ -18,7 +18,7 @@ isEmpty(qtver.value): error("No version for documentation specified.") qtmver.name = QT_VER qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1) qtvertag.name = QT_VERSION_TAG -qtvertag.value = $$replace(qtver.value, \.,) +qtvertag.value = $$replace(qtver.value, \\.,) qtdocs.name = QT_INSTALL_DOCS qtdocs.value = $$[QT_INSTALL_DOCS/src] builddir.name = BUILDDIR diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index b3e49e4626..2cb54fc547 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -31,22 +31,47 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET) !build_pass { MODULE = $$replace(TARGET, ^qt, ) + MODULE ~= s,-,_, MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri ucmodule = $$upper($$MODULE) + win32|CONFIG(static, static|shared) { + prefix = $$QMAKE_PREFIX_STATICLIB + suffix = $$QMAKE_EXTENSION_STATICLIB + } else { + prefix = $$QMAKE_PREFIX_SHLIB + suffix = $$QMAKE_EXTENSION_SHLIB + } + CC_USES = + LD_USES = + for (use, QMAKE_USE) { + use = $$split(use, /) + name = $$take_first(use) + nu = $$upper($$replace(name, -, _)) + !contains(use, linkonly): CC_USES += $$nu + !contains(use, nolink): LD_USES += $$nu + } + CC_USES = $$unique(CC_USES) + LD_USES = $$unique(LD_USES) MODULE_PRI_CONT = \ + "QMAKE_DEPENDS_$${ucmodule}_CC =$$join(CC_USES, " ", " ")" \ + "QMAKE_DEPENDS_$${ucmodule}_LD =$$join(LD_USES, " ", " ")" \ "QMAKE_INCDIR_$${ucmodule} = $$val_escape(MODULE_INCLUDEPATH)" \ "QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)" debug_and_release { - win32: MODULE_DEBUG_LIBS = -L$$DESTDIR -l$${TARGET}d - darwin: MODULE_DEBUG_LIBS = -L$$DESTDIR -l$${TARGET}_debug - MODULE_RELEASE_LIBS = -L$$DESTDIR -l$$TARGET + win32: \ + MODULE_DEBUG_LIBS = $$DESTDIR/$$prefix$${TARGET}d.$$suffix + else: darwin: \ + MODULE_DEBUG_LIBS = $$DESTDIR/$$prefix$${TARGET}_debug.$$suffix + else: \ + error("'$$QMAKE_PLATFORM' does not do debug_and_release.") + MODULE_RELEASE_LIBS = $$DESTDIR/$$prefix$${TARGET}.$$suffix MODULE_PRI_CONT += \ "QMAKE_LIBS_$${ucmodule} =" \ # Needed for the module to be recognized. "QMAKE_LIBS_$${ucmodule}_DEBUG = $$val_escape(MODULE_DEBUG_LIBS)" \ "QMAKE_LIBS_$${ucmodule}_RELEASE = $$val_escape(MODULE_RELEASE_LIBS)" } else { - MODULE_LIBS = -L$$DESTDIR -l$$THE_TARGET + MODULE_LIBS = $$DESTDIR/$$prefix$${THE_TARGET}.$$suffix MODULE_PRI_CONT += \ "QMAKE_LIBS_$${ucmodule} = $$val_escape(MODULE_LIBS)" } diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index 8f98987b99..1ebca17366 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -38,6 +38,8 @@ qt_install_headers { private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES private_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private + generated_privates: \ + private_headers.CONFIG += no_check_exist INSTALLS += private_headers qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 70d3520e5c..6b4b9143fa 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -239,6 +239,14 @@ headersclean:!internal_module { gcc_ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION} versionAtLeast(gcc_ver, 4.5): hcleanFLAGS += -Wdouble-promotion versionAtLeast(gcc_ver, 4.9): hcleanFLAGS += -Wfloat-conversion + # GCC 9 has a lot of false positives relating to this, so disable completely + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-deprecated-copy + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-redundant-move + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-format-overflow + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-init-list-lifetime c++11 { # only enabled for actual c++11 builds due to diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 163f52f23f..e0556ce960 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,6 +56,7 @@ defineReplace(qtExportLibsForModule) { for (lib, QT.$${1}.libraries) { NAME = $$upper($$lib) vars = \ + QMAKE_DEPENDS_$${NAME}_CC QMAKE_DEPENDS_$${NAME}_LD \ QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \ QMAKE_DEFINES_$$NAME QMAKE_INCDIR_$$NAME for (var, vars) { diff --git a/mkspecs/features/qt_targets.prf b/mkspecs/features/qt_targets.prf index 49f7e6bd43..b3c289a90b 100644 --- a/mkspecs/features/qt_targets.prf +++ b/mkspecs/features/qt_targets.prf @@ -1,4 +1,4 @@ QMAKE_TARGET_COMPANY = The Qt Company Ltd. isEmpty(QMAKE_TARGET_PRODUCT): QMAKE_TARGET_PRODUCT = Qt5 isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = C++ Application Development Framework -QMAKE_TARGET_COPYRIGHT = Copyright (C) 2017 The Qt Company Ltd. +QMAKE_TARGET_COPYRIGHT = Copyright (C) 2019 The Qt Company Ltd. diff --git a/mkspecs/features/qt_test_helper.prf b/mkspecs/features/qt_test_helper.prf index 5daa14731d..86b65dd884 100644 --- a/mkspecs/features/qt_test_helper.prf +++ b/mkspecs/features/qt_test_helper.prf @@ -16,8 +16,7 @@ # Additionally the helper's executable is suffixed with "_helper" to # avoid name clashes with its folder. -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline debug_and_release { CONFIG(debug, debug|release) { diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index a25846bd77..fa8ff1fb58 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -28,6 +28,7 @@ for(resource, RESOURCES) { !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \ warning("Failure to find: $$resource") qmake_immediate.files += $$resource + OTHER_FILES *= $$resource } RESOURCES -= $$resource next() @@ -57,6 +58,7 @@ for(resource, RESOURCES) { alias = $$relative_path($$file, $$abs_base) resource_file_content += \ "<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>" + OTHER_FILES *= $$file } } @@ -73,17 +75,16 @@ for(resource, RESOURCES) { } !isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static { - pluginName = $$lower($$replace(_PRO_FILE_, .*/([^/.]+)\\.[^/.]+, \\1)) - + pluginBaseName = $$basename(TARGET) + pluginName = $$lower($$replace(pluginBaseName, [-], _)) resource_init_function = $${pluginName}_plugin_resource_init DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function" - RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp GENERATED_SOURCES += $$RESOURCE_INIT_CPP QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP - !build_pass { + isEmpty(BUILDS)|build_pass { RESOURCE_INIT_CONT = \ "// This file is autogenerated by qmake. It contains a function that" \ "// references all resources the plugin includes and the function is" \ @@ -111,7 +112,7 @@ rcc.name = RCC ${QMAKE_FILE_IN} rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.CONFIG += add_inputs_as_makefile_deps dep_lines -!resources_big|ltcg|macx-xcode|contains(TEMPLATE, "vc.*") { +!resources_big|ltcg|macx-xcode|wasm|contains(TEMPLATE, "vc.*") { rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)} rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} diff --git a/mkspecs/features/win32/rtti.prf b/mkspecs/features/rtti.prf index 6d720d2438..6d720d2438 100644 --- a/mkspecs/features/win32/rtti.prf +++ b/mkspecs/features/rtti.prf diff --git a/mkspecs/features/win32/rtti_off.prf b/mkspecs/features/rtti_off.prf index b520bfa8b7..b520bfa8b7 100644 --- a/mkspecs/features/win32/rtti_off.prf +++ b/mkspecs/features/rtti_off.prf diff --git a/mkspecs/features/static_runtime.prf b/mkspecs/features/static_runtime.prf index 3275e6e2e2..e20bfc4281 100644 --- a/mkspecs/features/static_runtime.prf +++ b/mkspecs/features/static_runtime.prf @@ -1,7 +1,7 @@ msvc { # -MD becomes -MT, -MDd becomes -MTd - QMAKE_CFLAGS ~= s,^-MD(d?)$, -MT\1,g - QMAKE_CXXFLAGS ~= s,^-MD(d?)$, -MT\1,g + QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\\1,g + QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\\1,g } else: mingw { QMAKE_LFLAGS += -static } diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 79883b7f09..b8102c26b5 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -27,6 +27,13 @@ else: type = check $${type}.files = $${type}.path = . +# Make sure we explicitly load the debug version of the Qt libraries if needed +macos { + dyld_image_suffix.name = DYLD_IMAGE_SUFFIX + dyld_image_suffix.value = $$qtPlatformTargetSuffix() + QT_TOOL_ENV += dyld_image_suffix +} + # Add environment for non-installed builds. Do this first, so the # 'make' variable expansions don't end up in a batch file/script. QT_TOOL_NAME = target diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 4ecfb8d889..9c3a64aa8b 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -1,28 +1,22 @@ - -defineReplace(qtMakeExpand) { - out = "$$1" - for(ever) { - m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1) - equals(m, $$out): \ - return($$out) - out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m)) - } +defineTest(qtToolchainError) { + msg = \ + $$1 \ + "===================" \ + $$2 \ + "===================" \ + $$3 + error($$join(msg, $$escape_expand(\\n))) } -defineTest(qtCompilerErrror) { +defineTest(qtCompilerError) { !cross_compile: \ what = else: host_build: \ what = " host" else: \ what = " target" - msg = \ - "Cannot run$$what compiler '$$1'. Output:" \ - "===================" \ - $$2 \ - "===================" \ - "Maybe you forgot to setup the environment?" - error($$join(msg, $$escape_expand(\\n))) + qtToolchainError("Cannot run$$what compiler '$$1'. Output:", $$2, \ + "Maybe you forgot to setup the environment?") } cross_compile:host_build: \ @@ -30,6 +24,142 @@ cross_compile:host_build: \ else: \ target_prefix = QMAKE_CXX +# +# Determine and cache the compiler version +# + +defineReplace(qtVariablesFromMSVC) { + ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec) + !equals(ec, 0): qtCompilerError($$1, $$ret) + return($$ret) +} + +defineReplace(qtVariablesFromGCC) { + ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \ + 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) + !equals(ec, 0): qtCompilerError($$1, $$ret) + return($$ret) +} + +isEmpty($${target_prefix}.COMPILER_MACROS) { + msvc { + clang_cl { + # We need to obtain the cl.exe version first + vars = $$qtVariablesFromMSVC(cl) + for (v, vars) { + isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next() + eval($$v) + } + isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version") + + QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \ + "-fms-compatibility-version=\\1.\\2.\\3") + cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT) + $${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT + vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT) + } else { + vars = $$qtVariablesFromMSVC($$QMAKE_CXX) + } + } else: gcc|ghs { + vars = $$qtVariablesFromGCC($$QMAKE_CXX) + } + for (v, vars) { + !contains(v, "[A-Z_]+ = .*"): next() + # Set both <varname> for the outer scope ... + eval($$v) + v ~= s/ .*// + isEmpty($$v): error("Compiler produced empty value for $${v}.") + # ... and save QMAKE_(HOST_)?CXX.<varname> in the cache. + cache($${target_prefix}.$$v, set stash, $$v) + $${target_prefix}.COMPILER_MACROS += $$v + } + cache($${target_prefix}.COMPILER_MACROS, set stash) +} else { + # load from the cache + for (i, $${target_prefix}.COMPILER_MACROS): \ + $$i = $$eval($${target_prefix}.$$i) +} + +# Populate QMAKE_COMPILER_DEFINES and some compatibility variables. +# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal. +QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX +!isEmpty(QMAKE_MSC_VER): \ + QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER +!isEmpty(QMAKE_ICC_VER): \ + QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER +!isEmpty(QMAKE_APPLE_CC): \ + QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC +!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \ + QMAKE_COMPILER_DEFINES += __clang__ \ + __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \ + __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \ + __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION +!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \ + QMAKE_COMPILER_DEFINES += __clang__ \ + __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \ + __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \ + __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION +!isEmpty(QMAKE_GCC_MAJOR_VERSION): \ + QMAKE_COMPILER_DEFINES += \ + __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \ + __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \ + __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION +!isEmpty(QMAKE_GHS_VERSION): \ + QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION + +QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT + +clang_cl|intel_icl { + include(../common/msvc-based-version.conf) +} else: msvc { + include(../common/msvc-version.conf) +} + +# +# Determine and cache the default search paths +# + +defineReplace(qtMakeExpand) { + out = "$$1" + for(ever) { + m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1) + equals(m, $$out): \ + return($$out) + out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m)) + } +} + +defineReplace(qtSplitPathList) { + paths = $$split(1, $$QMAKE_DIRLIST_SEP) + ret = + for (p, paths): \ + ret += $$clean_path($$p) + return($$ret) +} + +defineReplace(qtNmakePathList) { + paths = + for (p, 1): \ + paths += $$shell_path($$p) + paths ~= s,$${LITERAL_HASH},^$${LITERAL_HASH},g + paths ~= s,\\$,\$\$,g + return($$join(paths, $$QMAKE_DIRLIST_SEP)) +} + +msvc { + arch = $$lower($$VCPROJ_ARCH) + equals(arch, x64): \ # may be "win32" or undefined + arch = amd64 + else: !equals(arch, arm):!equals(arch, arm64): \ # may be "win32" or undefined + arch = x86 + # Consider only WinRT and ARM64 desktop builds to be cross-builds - + # the host is assumed to be Intel and capable of running the target + # executables (so building for x64 on x86 will break). + winrt|equals(arch, arm64): \ + CONFIG += msvc_cross +} + isEmpty($${target_prefix}.INCDIRS) { # # Get default include and library paths from compiler @@ -69,7 +199,7 @@ isEmpty($${target_prefix}.INCDIRS) { cxx_flags += -E -v output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output) rim_qcc { for (line, output) { @@ -99,7 +229,10 @@ isEmpty($${target_prefix}.INCDIRS) { line ~= s/^[ \\t]*// # remove leading spaces contains(line, "LIBRARY_PATH=.*") { line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH= - paths = $$split(line, $$QMAKE_DIRLIST_SEP) + equals(QMAKE_HOST.os, Windows): \ + paths = $$split(line, ;) + else: \ + paths = $$split(line, $$QMAKE_DIRLIST_SEP) for (path, paths): \ QMAKE_DEFAULT_LIBDIRS += $$clean_path($$path) } else: contains(line, "Library search paths:") { @@ -128,12 +261,14 @@ isEmpty($${target_prefix}.INCDIRS) { # paths, so it can't just be used in place of the above code). # What's more, -print-search-dirs can't be used on clang on Apple because it # won't print all the library paths (only the clang-internal ones). - output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec) + !equals(ec, 0): qtCompilerError($$QMAKE_LINK, $$output) for (line, output) { contains(line, "^libraries: .*") { line ~= s,^libraries: ,, + # clang (7.x) on Windows uses the wrong path list separator ... + equals(QMAKE_HOST.os, Windows): line ~= s,:(?![/\\\\]),;, paths = $$split(line, $$QMAKE_DIRLIST_SEP) for (path, paths): \ QMAKE_DEFAULT_LIBDIRS += $$clean_path($$replace(path, ^=, $$[SYSROOT])) @@ -147,7 +282,7 @@ isEmpty($${target_prefix}.INCDIRS) { } else: ghs { cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp output = $$system("$$cmd", blob, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output) output ~= s/\\\\\\n {8}//g output = $$split(output, $$escape_expand(\\n)) for (line, output) { @@ -167,113 +302,121 @@ isEmpty($${target_prefix}.INCDIRS) { } } } + } else: msvc_cross { + # Use a batch file, because %VAR% in the system() call expands to + # the pre-script-call value, and !VAR! cannot be enabled outside + # a batch file without invoking another shell instance. + cmd = $$system_quote($$system_path($$PWD/data/dumpvcvars.bat)) + + hostArch = $$QMAKE_HOST.arch + equals(hostArch, x86_64): \ + hostArch = amd64 + !equals(arch, $$hostArch): \ + arch = $${hostArch}_$$arch + + isEmpty(MSVC_VER): \ + error("Mkspec does not specify MSVC_VER. Cannot continue.") + versionAtLeast(MSVC_VER, 15.0) { + dir = $$(VSINSTALLDIR) + isEmpty(dir): \ + dir = $$read_registry(HKLM, \ + "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\$$MSVC_VER", 32) + isEmpty(dir): \ + error("Failed to find the Visual Studio installation directory.") + cmd += $$system_quote($$dir\\VC\\Auxiliary\\Build\\vcvarsall.bat) $$arch + } else { + dir = $$(VCINSTALLDIR) + isEmpty(dir): \ + dir = $$read_registry(HKLM, \ + "Software\\Microsoft\\VisualStudio\\$$MSVC_VER\\Setup\\VC\\ProductDir", 32) + isEmpty(dir): \ + error("Failed to find the Visual C installation directory.") + cmd += $$system_quote($$dir\\vcvarsall.bat) $$arch + } + winrt: cmd += store + + isEmpty(WINSDK_VER): \ + error("Mkspec does not specify WINSDK_VER. Cannot continue.") + # We prefer the environment variable, because that may work around + # a broken registry entry after uninstalling a newer SDK. + # However, we do that only if the major+minor SDK version matches + # the one requested by the mkspec, as we might be building for a + # newer target than the host. + winsdk_ver = $$(WindowsSDKVersion) + !isEmpty(winsdk_ver) { + winsdk_ver ~= s,\\\\$,, # Work around SDK breakage. + !equals(WINSDK_VER, $$replace(winsdk_ver, ^(\\d+\\.\\d+).*$, \\1)): \ + winsdk_ver = + } + !isEmpty(winsdk_ver) { + cmd += $$winsdk_ver + } else { + winsdk_ver = $$read_registry(HKLM, \ + "Software\\Microsoft\\Microsoft SDKs\\Windows\\v$$WINSDK_VER\\ProductVersion", 32) + isEmpty(winsdk_ver): \ + error("Windows SDK $$WINSDK_VER requested by mkspec is not installed. Cannot continue.") + cmd += $${winsdk_ver}.0 + } + + output = $$system("$$cmd 2>&1", lines, ec) + !equals(ec, 0): \ + qtToolchainError("SDK setup script failed. Output:", $$output, \ + "Command was: $$cmd") + lines = $$output + for(ever) { + isEmpty(lines): \ + break() + line = $$take_first(lines) + equals(line, "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="): \ + break() + } + !count(lines, 3): \ + qtToolchainError("SDK setup script returned unexpected output:", $$output, \ + "Command was: $$cmd") + + # These contain only paths for the target. + QMAKE_DEFAULT_INCDIRS = $$qtSplitPathList($$member(lines, 0)) + QMAKE_DEFAULT_LIBDIRS = $$qtSplitPathList($$member(lines, 1)) + # PATH is inherently for the host, and paths that are not shadowed + # by vcvarsall.bat are assumed to contain only tools that work for + # both host and target builds. + QMAKE_DEFAULT_PATH = $$qtSplitPathList($$member(lines, 2)) + # We de-duplicate, because the script just prepends to the paths for + # the host, some of which are identical to the ones for the target. + QMAKE_DEFAULT_PATH = $$unique(QMAKE_DEFAULT_PATH) } else: msvc { - # This doesn't differentiate between host and target, - # but neither do the compilers. LIB = $$getenv("LIB") QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP) INCLUDE = $$getenv("INCLUDE") QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP) } - unix { + unix:if(!cross_compile|host_build) { isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib } - cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS) - cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS) + # cache() complains about undefined variables and doesn't persist empty ones. + !isEmpty(QMAKE_DEFAULT_INCDIRS): \ + cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS) + !isEmpty(QMAKE_DEFAULT_LIBDIRS): \ + cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS) + !isEmpty(QMAKE_DEFAULT_PATH): \ + cache($${target_prefix}.PATH, set stash, QMAKE_DEFAULT_PATH) } else { QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS) QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS) + QMAKE_DEFAULT_PATH = $$eval($${target_prefix}.PATH) } -# -# Determine and cache the compiler version -# - -defineReplace(qtVariablesFromMSVC) { - ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec) - !equals(ec, 0): qtCompilerErrror($$1, $$ret) - return($$ret) -} - -defineReplace(qtVariablesFromGCC) { - ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \ - 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) - !equals(ec, 0): qtCompilerErrror($$1, $$ret) - return($$ret) -} - -isEmpty($${target_prefix}.COMPILER_MACROS) { - msvc { - clang_cl { - # We need to obtain the cl.exe version first - vars = $$qtVariablesFromMSVC(cl) - for (v, vars) { - isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next() - eval($$v) - } - isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version") - - QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \ - "-fms-compatibility-version=\\1.\\2.\\3") - cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT) - $${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT - vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT) - } else { - vars = $$qtVariablesFromMSVC($$QMAKE_CXX) - } - } else: gcc|ghs { - vars = $$qtVariablesFromGCC($$QMAKE_CXX) - } - for (v, vars) { - !contains(v, "[A-Z_]+ = .*"): next() - # Set both <varname> for the outer scope ... - eval($$v) - v ~= s/ .*// - isEmpty($$v): error("Compiler produced empty value for $${v}.") - # ... and save QMAKE_(HOST_)?CXX.<varname> in the cache. - cache($${target_prefix}.$$v, set stash, $$v) - $${target_prefix}.COMPILER_MACROS += $$v - } - cache($${target_prefix}.COMPILER_MACROS, set stash) -} else { - # load from the cache - for (i, $${target_prefix}.COMPILER_MACROS): \ - $$i = $$eval($${target_prefix}.$$i) +msvc_cross { + qmake_inc_exp.name = INCLUDE + qmake_inc_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_INCDIRS) + qmake_lib_exp.name = LIB + qmake_lib_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_LIBDIRS) + qmake_path_exp.name = PATH + qmake_path_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_PATH) + QMAKE_EXPORTED_VARIABLES += qmake_inc_exp qmake_lib_exp qmake_path_exp } unset(target_prefix) - -# Populate QMAKE_COMPILER_DEFINES and some compatibility variables. -# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal. -QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX -!isEmpty(QMAKE_MSC_VER): \ - QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER -!isEmpty(QMAKE_ICC_VER): \ - QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER -!isEmpty(QMAKE_APPLE_CC): \ - QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC -!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \ - QMAKE_COMPILER_DEFINES += __clang__ \ - __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \ - __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \ - __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION -!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \ - QMAKE_COMPILER_DEFINES += __clang__ \ - __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \ - __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \ - __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION -!isEmpty(QMAKE_GCC_MAJOR_VERSION): \ - QMAKE_COMPILER_DEFINES += \ - __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \ - __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \ - __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION -!isEmpty(QMAKE_GHS_VERSION): \ - QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION - -QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT -QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT - -msvc:!intel_icl:!clang_cl: include(../common/msvc-version.conf) diff --git a/mkspecs/features/wasm/qt.prf b/mkspecs/features/wasm/qt.prf deleted file mode 100644 index 9b9b58d3de..0000000000 --- a/mkspecs/features/wasm/qt.prf +++ /dev/null @@ -1,12 +0,0 @@ - -qt_depends = $$resolve_depends(QT, "QT.") -equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) { - LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms - - lib_name = wasm - lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/lib$${lib_name}$$qtPlatformTargetSuffix() - LIBS += -l$${lib_name}$$qtPlatformTargetSuffix() $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS) -} - -load(qt) - diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf index 278a6719c7..de726c674c 100644 --- a/mkspecs/features/wasm/wasm.prf +++ b/mkspecs/features/wasm/wasm.prf @@ -2,6 +2,39 @@ # DESTDIR will be empty if not set in the app .pro file; make sure it has a value isEmpty(DESTDIR): DESTDIR = $$OUT_PWD +exists($$QMAKE_QT_CONFIG) { + qtConfig(thread) { + + EMCC_THREAD_LFLAGS += -s USE_PTHREADS=1 + # Hardcode wasm memory size. Emscripten does not currently support memory growth + # (ALLOW_MEMORY_GROWTH) in pthreads mode, and requires specifying the memory size + # at build time. Further, browsers limit the maximum initial memory size to 1GB. + TOTAL_MEMORY = 1GB + !isEmpty(QMAKE_WASM_TOTAL_MEMORY) { + TOTAL_MEMORY = $$QMAKE_WASM_TOTAL_MEMORY + } + + message("Setting TOTAL_MEMORY to" $$TOTAL_MEMORY) + EMCC_THREAD_LFLAGS += -s TOTAL_MEMORY=$$TOTAL_MEMORY + + # Create worker threads at startup. This is supposed to be an optimization, + # however exceeding the pool size has been obesverved to hang the application. + POOL_SIZE = 4 + !isEmpty(QMAKE_WASM_PTHREAD_POOL_SIZE) { + POOL_SIZE = $$QMAKE_WASM_PTHREAD_POOL_SIZE + } + + message("Setting PTHREAD_POOL_SIZE to" $$POOL_SIZE) + EMCC_THREAD_LFLAGS += -s PTHREAD_POOL_SIZE=$$POOL_SIZE + } else { + EMCC_THREAD_LFLAGS += -s ALLOW_MEMORY_GROWTH=1 + } + QMAKE_LFLAGS += $$EMCC_THREAD_LFLAGS + QMAKE_LFLAGS_DEBUG += $$EMCC_THREAD_LFLAGS + QMAKE_CFLAGS += $$EMCC_THREAD_LFLAGS + QMAKE_CXXFLAGS += $$EMCC_THREAD_LFLAGS +} + # Create js and wasm files for applications contains(TEMPLATE, .*app) { TARGET_BASE = $${TARGET} @@ -41,14 +74,14 @@ contains(TEMPLATE, .*app) { appjs.name = application qtloader.js appjs.output = $$DESTDIR/qtloader.js - appjs.commands = $$QMAKE_COPY $$WASM_PLUGIN_PATH/qtloader.js $$DESTDIR + appjs.commands = $$QMAKE_COPY $$shell_path($$WASM_PLUGIN_PATH/qtloader.js) $$shell_path($$DESTDIR) appjs.input = $$WASM_PLUGIN_PATH/qtloader.js appjs.depends = $$appjs.input QMAKE_EXTRA_COMPILERS += appjs appsvg.name = application qtlogo.svg appsvg.output = $$DESTDIR/qtlogo.svg - appsvg.commands = $$QMAKE_COPY $$WASM_PLUGIN_PATH/qtlogo.svg $$DESTDIR + appsvg.commands = $$QMAKE_COPY $$shell_path($$WASM_PLUGIN_PATH/qtlogo.svg) $$shell_path($$DESTDIR) appsvg.input = $$WASM_PLUGIN_PATH/qtlogo.svg appsvg.depends = $$appsvg.input QMAKE_EXTRA_COMPILERS += appsvg @@ -72,6 +105,13 @@ contains(TEMPLATE, .*app) { } } +# Pass --source-map-base on the linker line. This informs the +# browser where to find the source files when debugging. +WASM_SOURCE_MAP_BASE = http://localhost:8000/ +!isEmpty(QMAKE_WASM_SOURCE_MAP_BASE):\ + WASM_SOURCE_MAP_BASE = $$QMAKE_WASM_SOURCE_MAP_BASE +CONFIG(debug): QMAKE_LFLAGS += --source-map-base $$WASM_SOURCE_MAP_BASE + # Creates the stand-alone version of the library from bitcode !static:contains(TEMPLATE, .*lib): { load(resolve_target) diff --git a/mkspecs/features/win32/windeployqt.prf b/mkspecs/features/win32/windeployqt.prf index fb5b2c4234..1929b7000e 100644 --- a/mkspecs/features/win32/windeployqt.prf +++ b/mkspecs/features/win32/windeployqt.prf @@ -10,7 +10,6 @@ build_pass { windeployqt.commands = $$QMAKE_WINDEPLOYQT $$WINDEPLOYQT_OPTIONS -list target $$WINDEPLOYQT_TARGET > $$WINDEPLOYQT_OUTPUT windeployqt_clean.commands = if exist $$WINDEPLOYQT_OUTPUT for /f %i in ($$WINDEPLOYQT_OUTPUT) do $$QMAKE_DEL_FILE %~fi && $$QMAKE_DEL_DIR %~pi - QMAKE_EXTRA_TARGETS += windeployqt_clean DISTCLEAN_DEPS += windeployqt_clean QMAKE_DISTCLEAN += $$WINDEPLOYQT_OUTPUT } else { diff --git a/mkspecs/features/winrt/package_manifest.prf b/mkspecs/features/winrt/package_manifest.prf index d850254dcf..969343cfd7 100644 --- a/mkspecs/features/winrt/package_manifest.prf +++ b/mkspecs/features/winrt/package_manifest.prf @@ -5,34 +5,7 @@ # Afterwards, they can override the default template by assigning their template to WINRT_MANIFEST. # # All subkeys in WINRT_MANIFEST will be replaced if defined/found, so new variables can be easily -# added. The following keys have default values and are present in the default templates: -# WINRT_MANIFEST: The name of the input manifest file. Defaults to a file defined by the mkspec. -# WINRT_MANIFEST.target: The name of the target (.exe). Defaults to TARGET. -# WINRT_MANIFEST.identity: The unique ID of the app. Defaults to reusing the existing generated manifest's UUID, or generates a new UUID if none is present. -# WINRT_MANIFEST.name: The name of the package as displayed to the user. Defaults to TARGET. -# WINRT_MANIFEST.architecture: The target architecture. Defaults to VCPROJ_ARCH. -# WINRT_MANIFEST.version: The version number of the package. Defaults to "1.0.0.0". -# WINRT_MANIFEST.publisher: Display name of the publisher. Defaults to "Default publisher display name". -# WINRT_MANIFEST.publisher_id: The publisher's distinguished name (default: CN=MyCN). -# WINRT_MANIFEST.phone_product_id: The GUID of the product. Defaults to the value of WINRT_MANIFEST.identity. (Windows Phone only) -# WINRT_MANIFEST.phone_publisher_id: The GUID of the publisher. Defaults to an invalid GUID. (Windows Phone only) -# WINRT_MANIFEST.description: Package description. Defaults to "Default package description". -# WINRT_MANIFEST.background: Tile background color. Defaults to "green". -# WINRT_MANIFEST.foreground: Tile foreground (text) color (Windows 8/RT only). Defaults to "light". -# WINRT_MANIFEST.logo_store: Logo image file for Windows Store. Default provided by the mkspec. -# WINRT_MANIFEST.logo_small: Small logo image file. Default provided by the mkspec. -# WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec. -# WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec. -# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec. -# WINRT_MANIFEST.rotation_preference: Orientation specification. Default is empty. (portrait, landscape, landscapeFlipped) -# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec. -# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec. -# WINRT_MANIFEST.default_language: Specifies the default language of the application -# WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list. -# WINRT_MANIFEST.capabilities_device: Specifies device capabilities to add to the capability list. (location, webcam...) -# WINRT_MANIFEST.dependencies: Specifies dependencies required by the package. -# WINRT_MANIFEST.minVersion: Specifies the minimum required Windows version to run the package. Defaults to %UCRTVersion% -# WINRT_MANIFEST.maxVersionTested: Specifies the maximum Windows version the package has been tested against. Defaults to WINRT_MANIFEST.minVersion +# added. # The manifest is generated for each build pass for normal apps, and only once for vcapps. # - Normal apps have their package root directory in the same place as the target (one for each build pass). @@ -96,9 +69,10 @@ isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en *-msvc2015|*-msvc2017 { - isEmpty(WINRT_MANIFEST.minVersion): WINRT_MANIFEST.minVersion = $$(UCRTVersion) - isEmpty(WINRT_MANIFEST.minVersion): error("No UCRTVersion found in environment.")) - isEmpty(WINRT_MANIFEST.maxVersionTested): WINRT_MANIFEST.maxVersionTested = $$WINRT_MANIFEST.minVersion + isEmpty(WINRT_MANIFEST.minVersion): \ + WINRT_MANIFEST.minVersion = $$WINDOWS_TARGET_PLATFORM_VERSION + isEmpty(WINRT_MANIFEST.maxVersionTested): \ + WINRT_MANIFEST.maxVersionTested = $$WINDOWS_TARGET_PLATFORM_MIN_VERSION } INDENT = "$$escape_expand(\\r\\n) " diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index 3c80cbdfad..b1887aae7f 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -59,6 +59,7 @@ // We are hot - unistd.h should have turned on the specific APIs we requested +#include <features.h> #include <pthread.h> #include <dirent.h> #include <fcntl.h> diff --git a/mkspecs/integrity-armv7-imx6/qmake.conf b/mkspecs/integrity-armv7-imx6/qmake.conf index 3bf2abd844..eed6d41d35 100644 --- a/mkspecs/integrity-armv7-imx6/qmake.conf +++ b/mkspecs/integrity-armv7-imx6/qmake.conf @@ -6,7 +6,6 @@ include(../common/ghs-integrity-armv7.conf) DEFINES += QT_STATICPLUGIN -QTPLUGIN.platforms += qeglfs qeglfs-viv-integration QT_QPA_DEFAULT_PLATFORM = eglfs QMAKE_LIBS_EGL += -lEGL -lGAL -lVSC -lGLSLC -lGLESv2 -lfbdev -livfs diff --git a/mkspecs/integrity-armv7/qmake.conf b/mkspecs/integrity-armv7/qmake.conf index 7a2ffaba14..002c8b544e 100644 --- a/mkspecs/integrity-armv7/qmake.conf +++ b/mkspecs/integrity-armv7/qmake.conf @@ -5,5 +5,3 @@ include(../common/ghs-integrity-armv7.conf) DEFINES += QT_STATICPLUGIN - -QTPLUGIN.platforms += integrityfb diff --git a/mkspecs/integrity-armv8-rcar/qmake.conf b/mkspecs/integrity-armv8-rcar/qmake.conf index 46091f6a91..2dbe924086 100644 --- a/mkspecs/integrity-armv8-rcar/qmake.conf +++ b/mkspecs/integrity-armv8-rcar/qmake.conf @@ -11,7 +11,6 @@ DEFINES += INTEGRITY # parameter types as Symbian. The parameter types are defined in eglplatform.h. DEFINES += __WINSCW__ -QTPLUGIN.platforms += qeglfs QT_QPA_DEFAULT_PLATFORM = eglfs QMAKE_LIBS_EGL += -lEGL -lIMGegl -lsrv_um -lsrv_init -lpvrWSEGL_WM -lncg_usr.a -lmmgr_usr -lwm_usr -lprr_usr diff --git a/mkspecs/integrity-x86/qmake.conf b/mkspecs/integrity-x86/qmake.conf index 13d4a6c082..9e3569d15c 100644 --- a/mkspecs/integrity-x86/qmake.conf +++ b/mkspecs/integrity-x86/qmake.conf @@ -6,5 +6,3 @@ include(../common/ghs-integrity-x86.conf) QMAKE_CFLAGS += -cpu=Corei DEFINES += QT_STATICPLUGIN - -QTPLUGIN.platforms += integrityfb diff --git a/mkspecs/macx-xcode/default.xcscheme b/mkspecs/macx-xcode/default.xcscheme index bd2cb0e565..170174ed2b 100644 --- a/mkspecs/macx-xcode/default.xcscheme +++ b/mkspecs/macx-xcode/default.xcscheme @@ -26,6 +26,7 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "NO" + disableMainThreadChecker = "YES" buildConfiguration = "Debug"> <Testables> <TestableReference diff --git a/mkspecs/wasm-emscripten/qmake.conf b/mkspecs/wasm-emscripten/qmake.conf index c3b67310c8..c80f2bfb92 100644 --- a/mkspecs/wasm-emscripten/qmake.conf +++ b/mkspecs/wasm-emscripten/qmake.conf @@ -5,6 +5,17 @@ QMAKE_PLATFORM = wasm unix include(../common/gcc-base.conf) include(../common/clang.conf) +load(device_config) + +# Support setting WASM_OBJECT_FILES with -device-option WASM_OBJECT_FILES=1 +!isEmpty(WASM_OBJECT_FILES): { + !equals(WASM_OBJECT_FILES, 1):!equals(WASM_OBJECT_FILES, 0): \ + message(Error: The value for WASM_OBJECT_FILES must be 0 or 1) + QMAKE_CFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES + QMAKE_CXXFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES + QMAKE_LFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES +} + EMTERP_FLAGS = \ -s EMTERPRETIFY=1 \ -s EMTERPRETIFY_ASYNC=1 \ @@ -12,22 +23,17 @@ EMTERP_FLAGS = \ -s ASSERTIONS=1 \ --profiling-funcs -EMCC_COMMON_CFLAGS = \ - -s USE_LIBPNG=1 \ - -s USE_FREETYPE=1 \ - -s USE_ZLIB=1 - EMCC_COMMON_LFLAGS = \ -s WASM=1 \ -s FULL_ES2=1 \ - -s ALLOW_MEMORY_GROWTH=1 \ -s USE_WEBGL2=1 \ -s NO_EXIT_RUNTIME=0 \ -s ERROR_ON_UNDEFINED_SYMBOLS=1 \ --bind \ - -s \"BINARYEN_METHOD=\'native-wasm\'\" \ -s \"BINARYEN_TRAP_MODE=\'clamp\'\" +# The -s arguments can also be used with release builds, +# but are here in debug for clarity. EMCC_COMMON_LFLAGS_DEBUG = \ $$EMCC_COMMON_LFLAGS \ -s ASSERTIONS=2 \ @@ -38,34 +44,40 @@ EMCC_COMMON_LFLAGS_DEBUG = \ # -s SOCKET_DEBUG \ #print out socket,network data transfer -s GL_DEBUG=1 -# the -s arguments can also be used with release builds -# but here in debug for clarity +# Set up debug/optimization flags +QMAKE_CXXFLAGS_RELEASE -= -O2 +QMAKE_CFLAGS_RELEASE -= -O2 +equals(WASM_OBJECT_FILES, 1) { + QMAKE_LFLAGS_DEBUG += -g + + QMAKE_CXXFLAGS_RELEASE += -O3 + QMAKE_CFLAGS_RELEASE += -O3 + QMAKE_LFLAGS_RELEASE += -O3 + QMAKE_CFLAGS_OPTIMIZE += -O3 + QMAKE_CFLAGS_OPTIMIZE_FULL += -Oz +} else { + # Practical debugging setup: + # "-g4" preserves function names for stack traces + # "-Os" produces reasonably sized binaries + QMAKE_CFLAGS_DEBUG -= -g + QMAKE_CXXFLAGS_DEBUG -= -g + QMAKE_CFLAGS_DEBUG += -Os -g4 + QMAKE_CXXFLAGS_DEBUG += -Os -g4 + QMAKE_LFLAGS_DEBUG += -Os -g4 + + QMAKE_CXXFLAGS_RELEASE += -O3 + QMAKE_CFLAGS_RELEASE += -O3 + QMAKE_LFLAGS_RELEASE += -O3 + QMAKE_CFLAGS_OPTIMIZE += -O3 + QMAKE_CFLAGS_OPTIMIZE_FULL += -Oz +} + QMAKE_COMPILER += emscripten QMAKE_CC = emcc QMAKE_CXX = em++ -QMAKE_CFLAGS += $$EMCC_COMMON_CFLAGS -QMAKE_CXXFLAGS += $$EMCC_COMMON_CFLAGS - -# Practical debugging setup: -# "-g4" preserves function names for stack traces -# "-Os" produces reasonably sized binaries -QMAKE_CFLAGS_DEBUG -= -g -QMAKE_CXXFLAGS_DEBUG -= -g -QMAKE_CFLAGS_DEBUG += -Os -g4 -QMAKE_CXXFLAGS_DEBUG += -Os -g4 -QMAKE_LFLAGS_DEBUG += -Os -g4 - -QMAKE_CXXFLAGS_RELEASE -= -O2 -QMAKE_CXXFLAGS_RELEASE += -O3 -QMAKE_CFLAGS_RELEASE -= -O2 -QMAKE_CFLAGS_RELEASE += -O3 -QMAKE_LFLAGS_RELEASE += -O3 -MAKE_CFLAGS_OPTIMIZE += -O3 -MAKE_CFLAGS_OPTIMIZE_FULL += -Oz - QMAKE_LINK = $$QMAKE_CXX QMAKE_LINK_SHLIB = $$QMAKE_CXX QMAKE_LINK_C = $$QMAKE_CC @@ -84,7 +96,4 @@ QMAKE_EXTENSION_STATICLIB = a # llvm bitcode QMAKE_AR = emar cqs QMAKE_DISTCLEAN += *.html *.js *.wasm -QT_QPA_DEFAULT_PLATFORM = wasm - -QTPLUGIN.platforms = wasm load(qt_config) diff --git a/mkspecs/win32-arm64-msvc2017/qmake.conf b/mkspecs/win32-arm64-msvc2017/qmake.conf new file mode 100644 index 0000000000..ee10f9cc40 --- /dev/null +++ b/mkspecs/win32-arm64-msvc2017/qmake.conf @@ -0,0 +1,15 @@ +# +# qmake configuration for win32-arm64-msvc2017 +# +# Written for Microsoft C/C++ Optimizing Compiler targeting arm64. +# + +include(../common/msvc-desktop.conf) + +WINSDK_VER = 10.0 +VCPROJ_ARCH = ARM64 + +DEFINES += WIN64 +QMAKE_COMPILER_DEFINES += _WIN64 + +load(qt_config) diff --git a/mkspecs/win32-arm64-msvc2017/qplatformdefs.h b/mkspecs/win32-arm64-msvc2017/qplatformdefs.h new file mode 100644 index 0000000000..8a3afa7630 --- /dev/null +++ b/mkspecs/win32-arm64-msvc2017/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../win32-msvc/qplatformdefs.h" diff --git a/mkspecs/win32-clang-g++/qmake.conf b/mkspecs/win32-clang-g++/qmake.conf index 4630ec4602..59d42176f0 100644 --- a/mkspecs/win32-clang-g++/qmake.conf +++ b/mkspecs/win32-clang-g++/qmake.conf @@ -24,4 +24,12 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_LINK = $${CROSS_COMPILE}clang++ QMAKE_LINK_C = $${CROSS_COMPILE}clang +QMAKE_CFLAGS_LTCG = -flto=thin +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +QMAKE_CFLAGS_LTCG_FATOBJECTS = -flto +QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS +QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG + +QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz + load(qt_config) diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf index ba9704e069..5da7e2d1b2 100644 --- a/mkspecs/win32-clang-msvc/qmake.conf +++ b/mkspecs/win32-clang-msvc/qmake.conf @@ -6,6 +6,27 @@ include(../common/msvc-desktop.conf) +# clang-cl does not use anything above SSE2 without extra arguments +QMAKE_CFLAGS_SSE3 = -msse3 +QMAKE_CFLAGS_SSSE3 = -mssse3 +QMAKE_CFLAGS_SSE4_1 = -msse4.1 +QMAKE_CFLAGS_SSE4_2 = -msse4.2 +QMAKE_CFLAGS_AVX = -mavx +QMAKE_CFLAGS_AVX2 = -mavx2 +QMAKE_CFLAGS_F16C = -mf16c +QMAKE_CFLAGS_RDRND = -mrdrnd +QMAKE_CFLAGS_AVX512F = -mavx512f +QMAKE_CFLAGS_AVX512ER = -mavx512er +QMAKE_CFLAGS_AVX512CD = -mavx512cd +QMAKE_CFLAGS_AVX512PF = -mavx512pf +QMAKE_CFLAGS_AVX512DQ = -mavx512dq +QMAKE_CFLAGS_AVX512BW = -mavx512bw +QMAKE_CFLAGS_AVX512VL = -mavx512vl +QMAKE_CFLAGS_AVX512IFMA = -mavx512ifma +QMAKE_CFLAGS_AVX512VBMI = -mavx512vbmi +QMAKE_CFLAGS_AESNI = -maes +QMAKE_CFLAGS_SHANI = -msha + QMAKE_COMPILER += clang_cl llvm QMAKE_CC = clang-cl @@ -15,7 +36,19 @@ QMAKE_CFLAGS += -Wno-microsoft-enum-value QMAKE_CXXFLAGS += -Wno-microsoft-enum-value -# Precompiled headers are not supported yet by clang -CONFIG -= precompile_header +QMAKE_LINK = lld-link +QMAKE_LIB = llvm-lib /NOLOGO + +QMAKE_CFLAGS_LTCG = -flto=thin +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +QMAKE_CFLAGS_LTCG_FATOBJECTS = -flto +QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS +# Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters +QMAKE_LFLAGS_LTCG = + +QMAKE_CFLAGS_OPTIMIZE_SIZE = /clang:-Oz +QMAKE_CFLAGS_OPTIMIZE_FULL = /clang:-O3 + +QMAKE_LFLAGS_RELEASE += /OPT:REF,ICF,LBR load(qt_config) diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index ed131c6823..5de482f23b 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -8,6 +8,7 @@ # include(../common/g++-win32.conf) +include(../common/windows-desktop.conf) # modifications to g++-win32.conf @@ -22,4 +23,8 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_LINK = $${CROSS_COMPILE}g++ QMAKE_LINK_C = $${CROSS_COMPILE}gcc +QMAKE_CFLAGS_LTCG = -flto +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG + load(qt_config) diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf index 8bca6f4af8..bc113d4954 100644 --- a/mkspecs/winrt-arm-msvc2015/qmake.conf +++ b/mkspecs/winrt-arm-msvc2015/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = ARM WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = arm diff --git a/mkspecs/winrt-arm-msvc2017/qmake.conf b/mkspecs/winrt-arm-msvc2017/qmake.conf index bf571d620c..1160d5766d 100644 --- a/mkspecs/winrt-arm-msvc2017/qmake.conf +++ b/mkspecs/winrt-arm-msvc2017/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = ARM WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = arm diff --git a/mkspecs/winrt-arm-msvc2019/qmake.conf b/mkspecs/winrt-arm-msvc2019/qmake.conf new file mode 100644 index 0000000000..fe30a843eb --- /dev/null +++ b/mkspecs/winrt-arm-msvc2019/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-arm-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = ARM +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = arm diff --git a/mkspecs/winrt-arm-msvc2019/qplatformdefs.h b/mkspecs/winrt-arm-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-arm-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-arm64-msvc2017/qmake.conf b/mkspecs/winrt-arm64-msvc2017/qmake.conf new file mode 100644 index 0000000000..e53c9ba748 --- /dev/null +++ b/mkspecs/winrt-arm64-msvc2017/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-arm64-msvc2017 +# +# Written for Microsoft Visual C++ 2017 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 arm64 __arm64__ __arm64__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:arm64 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = arm64 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = arm64 diff --git a/mkspecs/winrt-arm64-msvc2017/qplatformdefs.h b/mkspecs/winrt-arm64-msvc2017/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-arm64-msvc2017/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-arm64-msvc2019/qmake.conf b/mkspecs/winrt-arm64-msvc2019/qmake.conf new file mode 100644 index 0000000000..8c16e93d26 --- /dev/null +++ b/mkspecs/winrt-arm64-msvc2019/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-arm64-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 arm64 __arm64__ __arm64__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:arm64 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = arm64 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = arm64 diff --git a/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h b/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf index d503399e3c..d1d1eb6513 100644 --- a/mkspecs/winrt-x64-msvc2015/qmake.conf +++ b/mkspecs/winrt-x64-msvc2015/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = x64 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x64 diff --git a/mkspecs/winrt-x64-msvc2017/qmake.conf b/mkspecs/winrt-x64-msvc2017/qmake.conf index cb2209fa23..dce896bd47 100644 --- a/mkspecs/winrt-x64-msvc2017/qmake.conf +++ b/mkspecs/winrt-x64-msvc2017/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = x64 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x64 diff --git a/mkspecs/winrt-x64-msvc2019/qmake.conf b/mkspecs/winrt-x64-msvc2019/qmake.conf new file mode 100644 index 0000000000..0d3b6d2196 --- /dev/null +++ b/mkspecs/winrt-x64-msvc2019/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-x64-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = x64 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = x64 diff --git a/mkspecs/winrt-x64-msvc2019/qplatformdefs.h b/mkspecs/winrt-x64-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-x64-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf index 37ce0e5525..06f059b600 100644 --- a/mkspecs/winrt-x86-msvc2015/qmake.conf +++ b/mkspecs/winrt-x86-msvc2015/qmake.conf @@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib VCPROJ_ARCH = Win32 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x86 diff --git a/mkspecs/winrt-x86-msvc2017/qmake.conf b/mkspecs/winrt-x86-msvc2017/qmake.conf index 3c9506bbad..94fb68f6c0 100644 --- a/mkspecs/winrt-x86-msvc2017/qmake.conf +++ b/mkspecs/winrt-x86-msvc2017/qmake.conf @@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib VCPROJ_ARCH = Win32 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x86 diff --git a/mkspecs/winrt-x86-msvc2019/qmake.conf b/mkspecs/winrt-x86-msvc2019/qmake.conf new file mode 100644 index 0000000000..8948e20ab1 --- /dev/null +++ b/mkspecs/winrt-x86-msvc2019/qmake.conf @@ -0,0 +1,18 @@ +# +# qmake configuration for winrt-x86-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib +VCPROJ_ARCH = Win32 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = x86 diff --git a/mkspecs/winrt-x86-msvc2019/qplatformdefs.h b/mkspecs/winrt-x86-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-x86-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../common/winrt_winphone/qplatformdefs.h" |