From 8cfac7fba69b9c903672e9f8eca9b8b752c640eb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 30 Aug 2016 12:07:20 -0700 Subject: configure: ask pkg-config only for the info we're interested No need to get libs flags other than -L and -l, since we're adding everything to the LIBS variable in qmake anyway. We wouldn't want rpath or other linker flags to leak through. Change-Id: I7d42fe4b581e49df891cfffd146fab61fecbc5c9 Reviewed-by: Jake Petroules Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 536ae2cd8a..bb93e3cffd 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -487,7 +487,7 @@ defineTest(qtConfLibrary_pkgConfig) { return(false) qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false) - qtRunLoggedCommand("$$pkg_config --libs $$args", $${1}.libs)|return(false) + qtRunLoggedCommand("$$pkg_config --libs-only-L --libs-only-l $$args", $${1}.libs)|return(false) qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false) qtRunLoggedCommand("$$pkg_config --cflags-only-I $$args", includes)|return(false) eval(includes = $$includes) -- cgit v1.2.3 From 4e53159d431e39c03488517588669ae2cc9052d1 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 30 Aug 2016 19:29:20 -0700 Subject: Mark Apple Clang 7.x as warning-free on macOS and (also Clang 3.9) iOS iOS was excluded in 09aeda21b902763919c2e0b2b06d09275d136e8c, probably unnecessarily. The build has been found to be warning-free. Change-Id: I81de2fff40938b6ab9f7a6a5b9f08f8a8baadb16 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_common.prf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index c1809468af..6512fb1db2 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -52,12 +52,12 @@ warnings_are_errors:warning_clean { # If the module declares that it has does its clean-up of warnings, enable -Werror. # This setting is compiler-dependent anyway because it depends on the version of the # compiler. - clang:!ios { - # Apple clang 4.0-4.2,5.0-5.1,6.0-6.4 + clang { + # Apple clang 4.0-4.2,5.0-5.1,6.0-6.4,7.0-7.3 # Regular clang 3.3-3.9 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]")|contains(reg_ver, "3\\.[3-9]") { + contains(apple_ver, "4\\.[012]|5\\.[01]|6\\.[01234]|7\\.[0123]")|contains(reg_ver, "3\\.[3-9]") { QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR } } else:intel_icc:linux { -- cgit v1.2.3 From 73331eebf885ba8918447d26ba37bef2208bdb5e Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 23 Aug 2016 15:16:42 -0700 Subject: Enable precompiled headers on iOS, tvOS, watchOS The actual blocker for precompiled headers is not the iOS/tvOS/watchOS platforms, but the way qmake handled multiple-architecture builds on Apple platforms. This patch allows multi-arch builds to be performed while using precompiled headers. Since df91ef3d6c55692a0236f67b6c6b134a3bf84098 (April 2009), Clang has had support for PCH files in the driver, which allows to use the -include flag to automatically translate to -include-pch. We can then take advantage of the fact that the -include option is allowed to not be separate from its argument, which lets us take advantage of -Xarch to specify a per-architecture precompiled header file. This is done through some magic in the qmake Makefile generator which "multiplexes" the PCH creation rule across multiple architectures and replaces a series of tokens with the proper precompiled header paths and architecture flags at usage point. Change-Id: I76c8dc9cda7e218869c2919f023d9b04f311c6fd Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/sdk.prf | 29 ++++++++++++++++++++++++----- mkspecs/features/uikit/default_post.prf | 2 ++ 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 5abc741b90..c7395ea572 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -56,13 +56,32 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_ !equals(MAKEFILE_GENERATOR, XCODE) { uikit:!host_buildĀ { - simulator: \ + ios: os_var = IOS + tvos: os_var = TVOS + watchos: os_var = WATCHOS + + deployment_target = $$eval(QMAKE_$${os_var}_DEPLOYMENT_TARGET) + simulator { + archs = $$eval(QMAKE_$${os_var}_SIMULATOR_ARCHS) version_identifier = $$simulator.deployment_identifier - else: \ + } else { + archs = $$eval(QMAKE_$${os_var}_DEVICE_ARCHS) version_identifier = $$device.deployment_identifier - ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET - tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET - watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET + } + + single_arch: archs = $$first(archs) + + QMAKE_CFLAGS_USE_PRECOMPILE = + for(arch, archs) { + QMAKE_CFLAGS_USE_PRECOMPILE += \ + -Xarch_$${arch} \ + -include${QMAKE_PCH_OUTPUT_$${arch}} + } + QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + + QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT} } else: osx { version_identifier = macosx deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf index 52c9b1e8c8..199074eefe 100644 --- a/mkspecs/features/uikit/default_post.prf +++ b/mkspecs/features/uikit/default_post.prf @@ -114,4 +114,6 @@ macx-xcode { QMAKE_CFLAGS += $$arch_flags QMAKE_CXXFLAGS += $$arch_flags QMAKE_LFLAGS += $$arch_flags + + QMAKE_PCH_ARCHS = $$VALID_ARCHS } -- cgit v1.2.3 From 4eb2feb29c5078cd3eda19e4d2331c54a35843ce Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 2 Sep 2016 15:42:52 +0200 Subject: Remove the ability to build simulator/device targets from SUBDIRS projects This is done because a followup patch will cause simulator_and_device builds to no longer use exclusive builds and so this feature could not work, but it is not strictly necessary anyways because users do not need to be able to do this. Done-with: Oswald Buddenhagen Change-Id: If869fbfea776751553c352c2d652edf745a3638d Reviewed-by: Oswald Buddenhagen --- mkspecs/features/uikit/resolve_config.prf | 34 ------------------------------- 1 file changed, 34 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/uikit/resolve_config.prf b/mkspecs/features/uikit/resolve_config.prf index c3ab90f45e..983dca82f4 100644 --- a/mkspecs/features/uikit/resolve_config.prf +++ b/mkspecs/features/uikit/resolve_config.prf @@ -32,37 +32,3 @@ macx-xcode { } else { addExclusiveBuilds(simulator, device) } - -equals(TEMPLATE, subdirs) { - # Prevent recursion into host_builds - for(subdir, SUBDIRS) { - contains($${subdir}.CONFIG, host_build) { - $${subdir}.CONFIG += no_$${simulator.target}_target no_$${device.target}_target - - # Other targets which we do want to recurse into may depend on this target, - # for example corelib depends on moc, rcc, bootstrap, etc, and other libs - # may depend on host-tools that are needed to build the lib, so we resolve - # the final target name and redirect it to the base target, so that the - # dependency chain is not broken for the other targets. - - !isEmpty($${subdir}.target) { - target = $$eval($${subdir}.target) - } else { - !isEmpty($${subdir}.file): \ - file = $$eval($${subdir}.file) - else: !isEmpty($${subdir}.subdir): \ - file = $$eval($${subdir}.subdir) - else: \ - file = $$subdir - - target = sub-$$file - } - - target ~= s,[^a-zA-Z0-9_],-, - - $${target}-$${simulator.target}.depends = $$target - $${target}-$${device.target}.depends = $$target - QMAKE_EXTRA_TARGETS += $${target}-$${simulator.target} $${target}-$${device.target} - } - } -} -- cgit v1.2.3 From 397f345a6a2c69c8f15f5d2f21989c303aca586e Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 25 Aug 2016 06:07:54 -0700 Subject: Remove simulator_and_device handling for the Makefile generator This patch moves towards a more sensible layout for UIKit platforms, where both the device and simulator architectures for binaries are combined into a single Mach-O file instead of separating out the simulator architecutures into separate _simulator.a files. This approach is both more common in the iOS ecosystem at large and significantly simplifies the implementation details for Qt, especially with the upcoming support for shared libraries on UIKit platforms. This patch takes advantage of the -Xarch compiler option to pass the appropriate -isysroot, -syslibroot, and -m*-version-min compiler and linker flags to the clang frontend, operating in exactly the same way as a normal multi-arch build for device or simulator did previously. Exclusive builds are still enabled for the xcodebuild wrapper Makefile, which builds all four configurations of a UIKit Xcode project as before, as expected. A particularly advantageous benefit of this change is that it flows very well with existing Xcode workflows, namely that: - Slicing out unused architectures is handled completely automatically for static builds, as an executable linking to a library with more architectures than it itself is linked as, the unused architectures will be ignored silently, resulting in the same behavior for users (and the App Store won't let you submit Intel architectures either). - Removing architectures from a fat binary using lipo does NOT invalidate the code signature of that file or its container if it is a bundle. This allows shared library and framework builds of Qt to work mostly automatically as well, since an Xcode shell script build phase can remove unused architectures from the embedded frameworks when that is implemented, and if Qt ever starts signing its SDK releases, it won't interfere with that either (though binaries are just resigned). Change-Id: I6c3578c78f75845a2fcc85f3a5b728ec997dbe90 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/sdk.prf | 62 ++++++++++++++++++++++--------- mkspecs/features/moc.prf | 5 ++- mkspecs/features/qt_functions.prf | 6 +-- mkspecs/features/qt_module.prf | 3 +- mkspecs/features/uikit/default_post.prf | 19 +++++----- mkspecs/features/uikit/default_pre.prf | 39 ++++++++----------- mkspecs/features/uikit/resolve_config.prf | 27 +------------- 7 files changed, 77 insertions(+), 84 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index c7395ea572..1db1db7b26 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -24,12 +24,6 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path) QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath) QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion) -!equals(MAKEFILE_GENERATOR, XCODE) { - QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH - QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH - QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH -} - sysrootified = for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val QMAKE_INCDIR_OPENGL = $$sysrootified @@ -61,15 +55,46 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_ watchos: os_var = WATCHOS deployment_target = $$eval(QMAKE_$${os_var}_DEPLOYMENT_TARGET) - simulator { - archs = $$eval(QMAKE_$${os_var}_SIMULATOR_ARCHS) - version_identifier = $$simulator.deployment_identifier - } else { - archs = $$eval(QMAKE_$${os_var}_DEVICE_ARCHS) - version_identifier = $$device.deployment_identifier + !simulator|simulator_and_device: device_archs = $$eval(QMAKE_$${os_var}_DEVICE_ARCHS) + simulator: simulator_archs = $$eval(QMAKE_$${os_var}_SIMULATOR_ARCHS) + archs = $$device_archs $$simulator_archs + + QMAKE_XARCH_CFLAGS = + QMAKE_XARCH_LFLAGS = + QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS + + single_arch { + device_archs = $$first(device_archs) + simulator_archs = $$first(simulator_archs) + archs = $$first(archs) } - single_arch: archs = $$first(archs) + for(arch, archs) { + contains(simulator_archs, $$arch) { + sdk = $$simulator.sdk + version_identifier = $$simulator.deployment_identifier + } else { + sdk = $$device.sdk + version_identifier = $$device.deployment_identifier + } + + version_min_flags = \ + -Xarch_$${arch} \ + -m$${version_identifier}-version-min=$$deployment_target + QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \ + -Xarch_$${arch} \ + -isysroot$$xcodeSDKInfo(Path, $$sdk) + QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \ + -Xarch_$${arch} \ + -Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk) + + QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch}) + QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch}) + + QMAKE_EXTRA_VARIABLES += \ + QMAKE_XARCH_CFLAGS_$${arch} \ + QMAKE_XARCH_LFLAGS_$${arch} + } QMAKE_CFLAGS_USE_PRECOMPILE = for(arch, archs) { @@ -85,10 +110,13 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_ } else: osx { version_identifier = macosx deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET + version_min_flag = -m$${version_identifier}-version-min=$$deployment_target + QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag + QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag + QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag } - version_min_flag = -m$${version_identifier}-version-min=$$deployment_target - QMAKE_CFLAGS += $$version_min_flag - QMAKE_CXXFLAGS += $$version_min_flag - QMAKE_LFLAGS += $$version_min_flag + QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS) + QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS) + QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS) } diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 73fbc8c29b..4c81ee5c74 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -25,8 +25,9 @@ win32:count(MOC_INCLUDEPATH, 40, >) { } # QNX's compiler sets "gcc" config, but does not support the -dM option; -# iOS builds are multi-arch, so this feature cannot possibly work. -if(gcc|intel_icl|msvc):!rim_qcc:!ios { +# UIKit builds are always multi-arch due to simulator_and_device (unless +# -sdk is used) so this feature cannot possibly work. +if(gcc|intel_icl|msvc):!rim_qcc:!uikit { moc_predefs.CONFIG = no_link gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 08c7c9f899..735ece45f2 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -1,10 +1,6 @@ defineReplace(qtPlatformTargetSuffix) { - uikit:CONFIG(simulator, simulator|device): \ - suffix = _$${simulator.sdk} - else: \ - suffix = - + suffix = CONFIG(debug, debug|release) { !debug_and_release|build_pass { mac: return($${suffix}_debug) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 90b4c181ee..ed02c597da 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -119,8 +119,7 @@ lib_bundle { QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.lib } !build_all| \ - if(if(!debug_and_release|CONFIG(release, debug|release)): \ - if(!simulator_and_device|CONFIG(device, simulator|device))) { + if(if(!debug_and_release|CONFIG(release, debug|release))) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf index 199074eefe..b4de83d6b5 100644 --- a/mkspecs/features/uikit/default_post.prf +++ b/mkspecs/features/uikit/default_post.prf @@ -91,15 +91,16 @@ macx-xcode { only_active_arch.build = debug QMAKE_MAC_XCODE_SETTINGS += only_active_arch } else { - # Be more specific about which architecture we're targeting - contains(QT_ARCH, arm.*) { - ios: VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS - tvos: VALID_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS - watchos: VALID_ARCHS = $$QMAKE_WATCHOS_DEVICE_ARCHS - } else { - ios: VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS - tvos: VALID_ARCHS = $$QMAKE_TVOS_SIMULATOR_ARCHS - watchos: VALID_ARCHS = $$QMAKE_WATCHOS_SIMULATOR_ARCHS + VALID_ARCHS = + !simulator|simulator_and_device { + ios: VALID_ARCHS += $$QMAKE_IOS_DEVICE_ARCHS + tvos: VALID_ARCHS += $$QMAKE_TVOS_DEVICE_ARCHS + watchos: VALID_ARCHS += $$QMAKE_WATCHOS_DEVICE_ARCHS + } + simulator { + ios: VALID_ARCHS += $$QMAKE_IOS_SIMULATOR_ARCHS + tvos: VALID_ARCHS += $$QMAKE_TVOS_SIMULATOR_ARCHS + watchos: VALID_ARCHS += $$QMAKE_WATCHOS_SIMULATOR_ARCHS } single_arch: VALID_ARCHS = $$first(VALID_ARCHS) diff --git a/mkspecs/features/uikit/default_pre.prf b/mkspecs/features/uikit/default_pre.prf index e719ab0848..8b5b3ccfe9 100644 --- a/mkspecs/features/uikit/default_pre.prf +++ b/mkspecs/features/uikit/default_pre.prf @@ -1,31 +1,22 @@ load(default_pre) -# In case Qt was built for a specific SDK -!isEmpty(QT_VERSION):!qtConfig(simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \ - CONFIG += simulator $${simulator.sdk} +!isEmpty(QT_VERSION) { + qtConfig(simulator_and_device)|contains(QMAKE_MAC_SDK, ^$${device.sdk}.*): \ + CONFIG += device $${device.sdk} + qtConfig(simulator_and_device)|contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \ + CONFIG += simulator $${simulator.sdk} + + qtConfig(simulator_and_device) { + # For a simulator_and_device build all the config tests + # are based on the device's ARM SDK, but we know that the simulator + # is Intel and that we support SSE/SSE2. + QT_CPU_FEATURES.$$QT_ARCH += sse sse2 + CONFIG += sse sse2 + DEFINES += QT_COMPILER_SUPPORTS_SSE2 + } +} # Check for supported Xcode versions lessThan(QMAKE_XCODE_VERSION, "4.3"): \ error("This mkspec requires Xcode 4.3 or later") - -build_pass:simulator { - # For a simulator_and_device build all the config tests - # are based on the iPhoneOS/WatchOS ARM SDK, but we know that the simulator - # is i386 and that we support SSE/SSE2. - QT_ARCH = i386 - QT_CPU_FEATURES.i386 = sse sse2 - DEFINES += QT_COMPILER_SUPPORTS_SSE2 - CONFIG -= neon - CONFIG += sse sse2 -} -build_pass:appletvsimulator { - # For a simulator_and_device build all the config tests - # are based on the AppleTVOS ARM SDK, but we know that the simulator - # is x64 and that we support SSE/SSE2. - QT_ARCH = x64 - QT_CPU_FEATURES.x64 = sse sse2 - DEFINES += QT_COMPILER_SUPPORTS_SSE2 - CONFIG -= neon - CONFIG += sse sse2 -} diff --git a/mkspecs/features/uikit/resolve_config.prf b/mkspecs/features/uikit/resolve_config.prf index 983dca82f4..70ddd8be52 100644 --- a/mkspecs/features/uikit/resolve_config.prf +++ b/mkspecs/features/uikit/resolve_config.prf @@ -1,34 +1,11 @@ xcodebuild { # Xcode project files always support both Debug and Release configurations - # and iOS device and simulator targets, so we make sure the wrapper-makefile + # and device and simulator targets, so we make sure the wrapper-makefile # also does. CONFIG += debug_and_release simulator_and_device } load(resolve_config) -# Legacy exclusive build configurations for backwards compatibility -CONFIG($${device.CONFIG}, $${device.CONFIG}|$${simulator.CONFIG}): \ - CONFIG += device -else: CONFIG($${simulator.CONFIG}, $${device.CONFIG}|$${simulator.CONFIG}): \ - CONFIG += simulator - -CONFIG(simulator, simulator|device): \ - CONFIG -= device $${device.CONFIG} -else: \ - CONFIG -= simulator $${simulator.CONFIG} - -macx-xcode { - # There is no way to genereate Xcode projects that are limited to either - # simulator or device builds, so simulator_and_device is always - # effectivly active, even if the user disabled it explicitly. - # The Xcode generator doesn't support multiple BUILDS though (exclusive - # builds), so we have to manually set up the simulator suffix. - library_suffix_simulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=$${simulator.sdk}*]" - library_suffix_simulator.value = "_$${simulator.sdk}$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})" - QMAKE_MAC_XCODE_SETTINGS += library_suffix_simulator - CONFIG *= xcode_dynamic_library_suffix -} else { - addExclusiveBuilds(simulator, device) -} +!macx-xcode:xcodebuild: addExclusiveBuilds(simulator, device) -- cgit v1.2.3 From 603628b1ea1a4003f6295fd97025bd38520af143 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 30 Aug 2016 10:26:57 -0700 Subject: Make DEVICE_ARCHS and SIMULATOR_ARCHS variables platform independent This reduces unnecessary OS conditions in qmake since these platforms are mutually exclusive, and also opens up their potential for use on macOS to transparently support multi-arch builds like UIKit platforms. This is also more similar to what Xcode does, as the DEPLOYMENT_TARGET variables are platform specific, while the ARCHS variable is not. DEPLOYMENT_TARGET has a use case for being OS specific in qmake (host tools vs targets), while ARCHS does not. Change-Id: Icee838a39e84259c2089faff08cc11d5f849758d Reviewed-by: Lars Knoll --- mkspecs/features/mac/sdk.prf | 11 +++++------ mkspecs/features/uikit/default_post.prf | 31 ++++++------------------------- mkspecs/macx-ios-clang/qmake.conf | 4 ++-- mkspecs/macx-tvos-clang/qmake.conf | 4 ++-- mkspecs/macx-watchos-clang/qmake.conf | 4 ++-- 5 files changed, 17 insertions(+), 37 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 1db1db7b26..0d43fbe5a1 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -50,13 +50,12 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_ !equals(MAKEFILE_GENERATOR, XCODE) { uikit:!host_buildĀ { - ios: os_var = IOS - tvos: os_var = TVOS - watchos: os_var = WATCHOS + ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET + tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET + watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET - deployment_target = $$eval(QMAKE_$${os_var}_DEPLOYMENT_TARGET) - !simulator|simulator_and_device: device_archs = $$eval(QMAKE_$${os_var}_DEVICE_ARCHS) - simulator: simulator_archs = $$eval(QMAKE_$${os_var}_SIMULATOR_ARCHS) + !simulator|simulator_and_device: device_archs = $$QMAKE_APPLE_DEVICE_ARCHS + simulator: simulator_archs = $$QMAKE_APPLE_SIMULATOR_ARCHS archs = $$device_archs $$simulator_archs QMAKE_XARCH_CFLAGS = diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf index b4de83d6b5..f34d0a9f2c 100644 --- a/mkspecs/features/uikit/default_post.prf +++ b/mkspecs/features/uikit/default_post.prf @@ -68,21 +68,10 @@ macx-xcode { macx-xcode { arch_device.name = "ARCHS[sdk=$${device.sdk}*]" arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]" - ios { - arch_device.value = $$QMAKE_IOS_DEVICE_ARCHS - arch_simulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS - QMAKE_XCODE_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS - } - tvos { - arch_device.value = $$QMAKE_TVOS_DEVICE_ARCHS - arch_simulator.value = $$QMAKE_TVOS_SIMULATOR_ARCHS - QMAKE_XCODE_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS $$QMAKE_TVOS_SIMULATOR_ARCHS - } - watchos { - arch_device.value = $$QMAKE_WATCHOS_DEVICE_ARCHS - arch_simulator.value = $$QMAKE_WATCHOS_SIMULATOR_ARCHS - QMAKE_XCODE_ARCHS = $$QMAKE_WATCHOS_DEVICE_ARCHS $$QMAKE_WATCHOS_SIMULATOR_ARCHS - } + + arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS + arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS + QMAKE_XCODE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS $$QMAKE_APPLE_SIMULATOR_ARCHS QMAKE_MAC_XCODE_SETTINGS += arch_device arch_simulator @@ -92,16 +81,8 @@ macx-xcode { QMAKE_MAC_XCODE_SETTINGS += only_active_arch } else { VALID_ARCHS = - !simulator|simulator_and_device { - ios: VALID_ARCHS += $$QMAKE_IOS_DEVICE_ARCHS - tvos: VALID_ARCHS += $$QMAKE_TVOS_DEVICE_ARCHS - watchos: VALID_ARCHS += $$QMAKE_WATCHOS_DEVICE_ARCHS - } - simulator { - ios: VALID_ARCHS += $$QMAKE_IOS_SIMULATOR_ARCHS - tvos: VALID_ARCHS += $$QMAKE_TVOS_SIMULATOR_ARCHS - watchos: VALID_ARCHS += $$QMAKE_WATCHOS_SIMULATOR_ARCHS - } + !simulator|simulator_and_device: VALID_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS + simulator: VALID_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS single_arch: VALID_ARCHS = $$first(VALID_ARCHS) diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf index 94eff0d237..5df225466f 100644 --- a/mkspecs/macx-ios-clang/qmake.conf +++ b/mkspecs/macx-ios-clang/qmake.conf @@ -7,8 +7,8 @@ QMAKE_IOS_DEPLOYMENT_TARGET = 7.0 # Universal target (iPhone and iPad) QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 -QMAKE_IOS_DEVICE_ARCHS = armv7 arm64 -QMAKE_IOS_SIMULATOR_ARCHS = i386 x86_64 +QMAKE_APPLE_DEVICE_ARCHS = armv7 arm64 +QMAKE_APPLE_SIMULATOR_ARCHS = i386 x86_64 include(../common/ios.conf) include(../common/gcc-base-mac.conf) diff --git a/mkspecs/macx-tvos-clang/qmake.conf b/mkspecs/macx-tvos-clang/qmake.conf index f389382450..8038ae6846 100644 --- a/mkspecs/macx-tvos-clang/qmake.conf +++ b/mkspecs/macx-tvos-clang/qmake.conf @@ -8,8 +8,8 @@ INCLUDEPATH += $$PWD/tvos QMAKE_TVOS_TARGETED_DEVICE_FAMILY = 3 -QMAKE_TVOS_DEVICE_ARCHS = arm64 -QMAKE_TVOS_SIMULATOR_ARCHS = x86_64 +QMAKE_APPLE_DEVICE_ARCHS = arm64 +QMAKE_APPLE_SIMULATOR_ARCHS = x86_64 include(../common/tvos.conf) include(../common/gcc-base-mac.conf) diff --git a/mkspecs/macx-watchos-clang/qmake.conf b/mkspecs/macx-watchos-clang/qmake.conf index bb9ab703b7..3ad02b636e 100644 --- a/mkspecs/macx-watchos-clang/qmake.conf +++ b/mkspecs/macx-watchos-clang/qmake.conf @@ -8,8 +8,8 @@ INCLUDEPATH += $$PWD/watchos QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY = 4 -QMAKE_WATCHOS_DEVICE_ARCHS = armv7k -QMAKE_WATCHOS_SIMULATOR_ARCHS = i386 +QMAKE_APPLE_DEVICE_ARCHS = armv7k +QMAKE_APPLE_SIMULATOR_ARCHS = i386 include(../common/watchos.conf) include(../common/gcc-base-mac.conf) -- cgit v1.2.3 From beaa792e2021aad52ecd98a0e0f0f48571069dba Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 30 Aug 2016 10:35:50 -0700 Subject: Make TARGETED_DEVICE_FAMILY variable platform independent This reduces unnecessary OS conditions in qmake since these platforms are mutually exclusive, and also opens up their potential for use on future devices (like carOS(?), which is device idiom '5'). This is also more similar to what Xcode does, as the TARGETED_DEVICE_FAMILY variable is not platform specific. Change-Id: I29d209cd8e0779f492bda829008264773e13c75c Reviewed-by: Lars Knoll --- mkspecs/features/uikit/default_post.prf | 9 ++++++--- mkspecs/macx-ios-clang/qmake.conf | 2 +- mkspecs/macx-tvos-clang/qmake.conf | 2 +- mkspecs/macx-watchos-clang/qmake.conf | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf index f34d0a9f2c..9a231ffc84 100644 --- a/mkspecs/features/uikit/default_post.prf +++ b/mkspecs/features/uikit/default_post.prf @@ -19,10 +19,13 @@ equals(TEMPLATE, app):qt { load(default_post) macx-xcode { + ios:isEmpty(QMAKE_APPLE_TARGETED_DEVICE_FAMILY):!isEmpty(QMAKE_IOS_TARGETED_DEVICE_FAMILY) { + warning("QMAKE_IOS_TARGETED_DEVICE_FAMILY is deprecated; use QMAKE_APPLE_TARGETED_DEVICE_FAMILY") + QMAKE_APPLE_TARGETED_DEVICE_FAMILY = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY + } + device_family.name = TARGETED_DEVICE_FAMILY - ios: device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY - tvos: device_family.value = $$QMAKE_TVOS_TARGETED_DEVICE_FAMILY - watchos: device_family.value = $$QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY + device_family.value = $$QMAKE_APPLE_TARGETED_DEVICE_FAMILY QMAKE_MAC_XCODE_SETTINGS += device_family ios { diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf index 5df225466f..e21445deb7 100644 --- a/mkspecs/macx-ios-clang/qmake.conf +++ b/mkspecs/macx-ios-clang/qmake.conf @@ -5,7 +5,7 @@ QMAKE_IOS_DEPLOYMENT_TARGET = 7.0 # Universal target (iPhone and iPad) -QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 +QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2 QMAKE_APPLE_DEVICE_ARCHS = armv7 arm64 QMAKE_APPLE_SIMULATOR_ARCHS = i386 x86_64 diff --git a/mkspecs/macx-tvos-clang/qmake.conf b/mkspecs/macx-tvos-clang/qmake.conf index 8038ae6846..e945cc9d28 100644 --- a/mkspecs/macx-tvos-clang/qmake.conf +++ b/mkspecs/macx-tvos-clang/qmake.conf @@ -6,7 +6,7 @@ QMAKE_TVOS_DEPLOYMENT_TARGET = 9.1 INCLUDEPATH += $$PWD/tvos -QMAKE_TVOS_TARGETED_DEVICE_FAMILY = 3 +QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 3 QMAKE_APPLE_DEVICE_ARCHS = arm64 QMAKE_APPLE_SIMULATOR_ARCHS = x86_64 diff --git a/mkspecs/macx-watchos-clang/qmake.conf b/mkspecs/macx-watchos-clang/qmake.conf index 3ad02b636e..03c05ad717 100644 --- a/mkspecs/macx-watchos-clang/qmake.conf +++ b/mkspecs/macx-watchos-clang/qmake.conf @@ -6,7 +6,7 @@ QMAKE_WATCHOS_DEPLOYMENT_TARGET = 2.2 INCLUDEPATH += $$PWD/watchos -QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY = 4 +QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 4 QMAKE_APPLE_DEVICE_ARCHS = armv7k QMAKE_APPLE_SIMULATOR_ARCHS = i386 -- cgit v1.2.3 From 5d771eb0c89e8d04ae05007b58442dc944b8684c Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 1 Sep 2016 11:04:33 +0200 Subject: Add BLACKLIST to builtin_testdata For platforms which require packaging the testdata into the application resources, the BLACKLIST file needs to be added. Otherwise it will not be found during runtime. Change-Id: I2d5c3b3040b3b268bc73254459b8b902b7fae4e2 Reviewed-by: Oliver Wolff --- mkspecs/features/testcase.prf | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 08ed00715d..64a6a9266b 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -181,6 +181,11 @@ isEmpty(BUILDS)|build_pass { builtin_testdata { ALL_TESTDATA = $$TESTDATA $$GENERATED_TESTDATA + + # BLACKLIST needs to be added to the testdata + BLACKLISTPATH = $$_PRO_FILE_PWD_/BLACKLIST + exists($$BLACKLISTPATH): ALL_TESTDATA *= $$BLACKLISTPATH + # RESOURCES does not support wildcards (for good reasons) for(td, ALL_TESTDATA): \ testdata.files += $$files($$absolute_path($$td, $$_PRO_FILE_PWD_)) -- cgit v1.2.3 From b95b00c61a5500bc6fc003cd8a222c1b57622880 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 24 Aug 2016 09:29:47 +0200 Subject: Be more robust when reading the library version number from pkg-config Ignore everything that after the initial period separated numbers. Change-Id: I376b154ff0ab6e3877223ec1383ed4708ecd2164 Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index bb93e3cffd..2067829a10 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -493,6 +493,7 @@ defineTest(qtConfLibrary_pkgConfig) { eval(includes = $$includes) includes ~= s/^-I//g $${1}.includedir = "$$val_escape(includes)" + version ~= s/[^0-9.].*$// $${1}.version = $$first(version) export($${1}.libs) export($${1}.cflags) -- cgit v1.2.3 From 60e5a1c8effd4099f7b1414107b5cbb67c266210 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 25 Aug 2016 15:45:44 +0200 Subject: Modularize the new configure system (infrastructure part) This change implements the required infrastructure to modularize the new configuration system. This requires a hierarchy of configuration files, both for handling multiple repositories and for individual modules inside the same repository. When configuring, they all need to get loaded first, as command line processing needs to know about all possible command line options. When the command line has been processed, the individual configuration files need to get processed one after the other and independently from each other. Configure is now automatically invoked when building the a project tree's "root" project; this works with both modular and top-level builds of Qt (the latter with an according change in the super repo). As an immediate consequence, the -skip option moves to the super repo with a different implementation, as configuration is now done after the repo list is determined. The option belongs there anyway. This commit also adds an optional testDir entry to the json file. Like this, we can still have all configure tests in qtbase/config.tests and the configuration file in, e.g., corelib can reference those. The files section can now be left out as long as a 'module' entry is present, specifying the module name. The names of the files to generate can then be deduced from that name. We still need to be able to specify names directly for the global configuration files. qtConfig() now also queries features which are module-specific. As it is sometimes necessary to query the configuration of modules which should not be actually linked (and cannot in the case of subdirs projects), the new variable QT_FOR_CONFIG which allows specifying configuration-only dependencies is introduced. Done-with: Oswald Buddenhagen Change-Id: Id1b518a3aa34044748b87fb8fac14d79653f6b18 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- mkspecs/features/configure.prf | 2 + mkspecs/features/configure_base.prf | 2 - mkspecs/features/qt_build_config.prf | 23 ++ mkspecs/features/qt_configure.prf | 498 ++++++++++++++++++++++----------- mkspecs/features/qt_functions.prf | 16 +- mkspecs/features/qt_module_headers.prf | 10 + mkspecs/features/qt_module_pris.prf | 43 ++- mkspecs/features/qt_parts.prf | 3 + 8 files changed, 430 insertions(+), 167 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index bd53e31a04..f275e3ac06 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -1,5 +1,7 @@ load(configure_base) +isEmpty(QMAKE_CONFIG_TESTS_DIR): QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests + # Try to build the test project in $$QMAKE_CONFIG_TESTS_DIR/$$1 # ($$_PRO_FILE_PWD_/config.tests/$$1 by default). # diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf index 08edba4b1c..dc630a3528 100644 --- a/mkspecs/features/configure_base.prf +++ b/mkspecs/features/configure_base.prf @@ -43,8 +43,6 @@ defineTest(qtRunLoggedCommand) { return(true) } -isEmpty(QMAKE_CONFIG_TESTS_DIR): QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests - # Ensure that a cache is present. If none was found on startup, this will create # one in the build directory of the project which loads this feature. cache() diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index e0e8ef9f51..95e63ecae0 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -95,3 +95,26 @@ defineTest(qtNomakeTools) { export($${d}.CONFIG) } } + +# This overloads the same function from qt_functions.prf. +# This is not in qt_module.prf, as that gets loaded too late. +defineTest(qtConfig) { + modules = $$QT $$QT_PRIVATE $$QT_FOR_PRIVATE $$QT_FOR_CONFIG + modules ~= s,-private$,_private,g + modules = $$resolve_depends(modules, "QT.", ".depends") + isEmpty(MODULE): \ + MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) + exists($$OUT_PWD/qt$${MODULE}-config.pri) { + include($$OUT_PWD/qt$${MODULE}-config.pri) + modules += $${MODULE} $${MODULE}_private + } + modules += global global_private + modules = $$reverse(modules) + for (module, modules) { + contains(QT.$${module}.enabled_features, $$1): \ + return(true) + contains(QT.$${module}.disabled_features, $$1): \ + return(false) + } + error("Could not find feature $${1}.") +} diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 2067829a10..79fede1525 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1,8 +1,3 @@ -CONFIG -= qt debug_and_release -load(configure_base) - -QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache -QMAKE_CONFIG_CACHE_USE = all QT_CONFIGURE_REPORT = QT_CONFIGURE_NOTES = @@ -36,8 +31,8 @@ defineTest(qtConfAddError) { defineTest(qtConfCommandlineSetInput) { arg = $${1} val = $${2} - !isEmpty(config.commandline.options.$${arg}.name): \ - arg = $$eval(config.commandline.options.$${arg}.name) + !isEmpty($${currentConfig}.commandline.options.$${arg}.name): \ + arg = $$eval($${currentConfig}.commandline.options.$${arg}.name) config.input.$$arg = $$val export(config.input.$$arg) @@ -74,7 +69,7 @@ defineTest(qtConfCommandline_void) { return() } - val = $$eval(config.commandline.options.$${opt}.value) + val = $$eval($${currentConfig}.commandline.options.$${opt}.value) isEmpty(val): val = yes qtConfCommandlineSetInput($$opt, $$val) @@ -86,11 +81,11 @@ defineTest(qtConfCommandline_enum) { isEmpty(val): val = yes # validate and map value - mapped = $$eval(config.commandline.options.$${opt}.values.$${val}) + mapped = $$eval($${currentConfig}.commandline.options.$${opt}.values.$${val}) isEmpty(mapped) { # just a list of allowed values - for (i, config.commandline.options.$${opt}.values._KEYS_) { - equals(config.commandline.options.$${opt}.values.$${i}, $$val) { + for (i, $${currentConfig}.commandline.options.$${opt}.values._KEYS_) { + equals($${currentConfig}.commandline.options.$${opt}.values.$${i}, $$val) { mapped = $$val break() } @@ -108,12 +103,12 @@ defineTest(qtConfValidateValue) { opt = $${1} val = $${2} - validValues = $$eval(config.commandline.options.$${opt}.values._KEYS_) + validValues = $$eval($${currentConfig}.commandline.options.$${opt}.values._KEYS_) isEmpty(validValues): \ return(true) for (i, validValues) { - equals(config.commandline.options.$${opt}.values.$${i}, $$val): \ + equals($${currentConfig}.commandline.options.$${opt}.values.$${i}, $$val): \ return(true) } @@ -169,20 +164,24 @@ defineTest(qtConfCommandline_addString) { !qtConfValidateValue($$opt, $$val): \ return() - !isEmpty(config.commandline.options.$${opt}.name): \ - opt = $$eval(config.commandline.options.$${opt}.name) + !isEmpty($${currentConfig}.commandline.options.$${opt}.name): \ + opt = $$eval($${currentConfig}.commandline.options.$${opt}.name) config.input.$$opt += $$val export(config.input.$$opt) } defineTest(qtConfParseCommandLine) { - custom = $$config.commandline.custom - customCall = - !isEmpty(custom) { - customCall = qtConfCommandline_$$custom - !defined($$customCall, test): \ - error("Custom command line callback '$$custom' is undefined.") + customCalls = + for (cc, allConfigs) { + custom = $$eval($${cc}.commandline.custom) + + !isEmpty(custom) { + customCall = qtConfCommandline_$$custom + !defined($$customCall, test): \ + error("Custom command line callback '$$custom' is undefined.") + customCalls += $$customCall + } } for (ever) { @@ -212,15 +211,24 @@ defineTest(qtConfParseCommandLine) { next() } - !isEmpty(customCall) { - $${customCall}($$c): \ - next() + didCustomCall = false + for (customCall, customCalls) { + $${customCall}($$c) { + didCustomCall = true + break() + } } + $$didCustomCall: \ + next() contains(c, "([A-Z_]+)=(.*)") { opt = $$replace(c, "^([A-Z_]+)=(.*)", "\\1") val = $$replace(c, "^([A-Z_]+)=(.*)", "\\2") - var = $$eval(config.commandline.assignments.$${opt}) + for (cc, allConfigs) { + var = $$eval($${cc}.commandline.assignments.$${opt}) + !isEmpty(var): \ + break() + } isEmpty(var) { qtConfAddError("Assigning unknown variable '$$opt' on command line.") return() @@ -254,20 +262,26 @@ defineTest(qtConfParseCommandLine) { return() } - type = $$eval(config.commandline.options.$${opt}) - isEmpty(type): \ - type = $$eval(config.commandline.options.$${opt}.type) - isEmpty(type) { - # no match in the regular options, try matching the prefixes - for (p, config.commandline.prefix._KEYS_) { - e = "^-$${p}(.*)" - contains(c, $$e) { - opt = $$eval(config.commandline.prefix.$${p}) - val = $$replace(c, $$e, "\\1") - type = "addString" - break() + for (cc, allConfigs) { + type = $$eval($${cc}.commandline.options.$${opt}) + isEmpty(type): \ + type = $$eval($${cc}.commandline.options.$${opt}.type) + isEmpty(type) { + # no match in the regular options, try matching the prefixes + for (p, $${cc}.commandline.prefix._KEYS_) { + e = "^-$${p}(.*)" + contains(c, $$e) { + opt = $$eval($${cc}.commandline.prefix.$${p}) + val = $$replace(c, $$e, "\\1") + type = "addString" + break() + } } } + !isEmpty(type) { + currentConfig = $$cc + break() + } } # handle builtin [-no]-feature-xxx isEmpty(type):contains(opt, "feature-(.*)") { @@ -368,8 +382,8 @@ defineReplace(qtConfPrepareArgs) { } defineTest(qtConfSetupLibraries) { - for (l, config.libraries._KEYS_) { - lpfx = config.libraries.$${l} + for (l, $${currentConfig}.libraries._KEYS_) { + 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 @@ -396,8 +410,8 @@ defineTest(qtConfSetupLibraries) { } # reverse mapping for assignments on command line. - for (a, config.commandline.assignments._KEYS_) { - apfx = config.commandline.assignments.$${a} + for (a, $${currentConfig}.commandline.assignments._KEYS_) { + apfx = $${currentConfig}.commandline.assignments.$${a} ra = config.commandline.rev_assignments.$$eval($$apfx) $$ra = $$a export($$ra) @@ -570,10 +584,12 @@ defineTest(qtConfExportLibrary) { qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_MINOR, $$member(version, 1)) qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_PATCH, $$member(version, 2)) } + !isEmpty($${currentConfig}.module): \ + qtConfExtendVar($$output, "QT.$${currentModule}_private.libraries", $$2) } defineTest(qtConfHandleLibrary) { - lpfx = config.libraries.$$1 + lpfx = $${currentConfig}.libraries.$$1 defined($${lpfx}.result, var): return() qtConfEnsureTestTypeDeps("library") @@ -647,10 +663,10 @@ defineTest(qtConfTest_library) { defineTest(qtConfTestPrepare_compile) { for (u, $$list($$eval($${1}.use))) { - !contains(config.libraries._KEYS_, $$u): \ + !contains($${currentConfig}.libraries._KEYS_, $$u): \ error("Test $$1 tries to use undeclared library '$$u'") qtConfHandleLibrary($$u) - lpfx = config.libraries.$${u} + lpfx = $${currentConfig}.libraries.$${u} isEmpty($${lpfx}.source): \ return(false) $${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source)) @@ -820,12 +836,12 @@ defineTest(qtConfIsBoolean) { } defineTest(qtConfSetupTestTypeDeps) { - for (tt, config.testTypeDependencies._KEYS_) { + for (tt, $${currentConfig}.testTypeDependencies._KEYS_) { !defined(qtConfTest_$${tt}, test): \ error("Declaring dependency for undefined test type '$$tt'.") - for (f, config.testTypeDependencies.$${tt}._KEYS_) { - feature = $$eval(config.testTypeDependencies.$${tt}.$${f}) - isEmpty(config.features.$${feature}._KEYS_): \ + for (f, $${currentConfig}.testTypeDependencies.$${tt}._KEYS_) { + feature = $$eval($${currentConfig}.testTypeDependencies.$${tt}.$${f}) + isEmpty($${currentConfig}.features.$${feature}._KEYS_): \ error("Test type '$$tt' depends on undefined feature '$$feature'.") } } @@ -834,31 +850,31 @@ defineTest(qtConfSetupTestTypeDeps) { # the call to another one. The former representation is more natural # (and concise) to write, while the latter is more efficient to process. # Hence, this function inverts the mapping. - for (tt, config.testTypeAliases._KEYS_) { + for (tt, $${currentConfig}.testTypeAliases._KEYS_) { !defined(qtConfTest_$${tt}, test): \ error("Aliasing undefined test type '$$tt'.") - for (tta, config.testTypeAliases.$${tt}._KEYS_) { - type = $$eval(config.testTypeAliases.$${tt}.$${tta}) + for (tta, $${currentConfig}.testTypeAliases.$${tt}._KEYS_) { + type = $$eval($${currentConfig}.testTypeAliases.$${tt}.$${tta}) !defined(qtConfTest_$${type}, test): \ error("Aliasing '$$tt' to undefined test type '$$type'.") - config.testTypeForwards.$${type} += $$tt - export(config.testTypeForwards.$${type}) + $${currentConfig}.testTypeForwards.$${type} += $$tt + export($${currentConfig}.testTypeForwards.$${type}) } } } defineTest(qtConfEnsureTestTypeDeps) { - depsn = config.testTypeDependencies.$${1}._KEYS_ + depsn = $${currentConfig}.testTypeDependencies.$${1}._KEYS_ !isEmpty($$depsn) { for (dep, $$depsn) { - feature = $$eval(config.testTypeDependencies.$${1}.$${dep}) + feature = $$eval($${currentConfig}.testTypeDependencies.$${1}.$${dep}) !qtConfCheckFeature($$feature): \ error("Test type '$$1' depends on non-emitted feature $${feature}.") } $$depsn = export($$depsn) } - fwdsn = config.testTypeForwards.$${1} + fwdsn = $${currentConfig}.testTypeForwards.$${1} !isEmpty($$fwdsn) { for (fwd, $$fwdsn): \ qtConfEnsureTestTypeDeps($$fwd) @@ -868,7 +884,7 @@ defineTest(qtConfEnsureTestTypeDeps) { } defineTest(qtRunSingleTest) { - tpfx = config.tests.$${1} + tpfx = $${currentConfig}.tests.$${1} defined($${tpfx}.result, var): \ return() @@ -945,10 +961,10 @@ defineReplace(qtConfEvaluateSingleExpression) { var = $$section(e, ".", 2, -1) isEmpty(var): \ var = result - !contains(config.tests._KEYS_, $$test): \ + !contains($${currentConfig}.tests._KEYS_, $$test): \ error("Unknown test object $${test} in expression '$${1}'.") qtRunSingleTest($$test) - result = $$eval(config.tests.$${test}.$${var}) + result = $$eval($${currentConfig}.tests.$${test}.$${var}) } else: contains(e, "^libs\..*") { !qt_conf_tests_allowed: \ error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.") @@ -956,22 +972,36 @@ defineReplace(qtConfEvaluateSingleExpression) { var = $$section(e, ".", 2, -1) isEmpty(var): \ var = result - !contains(config.libraries._KEYS_, $$lib): \ + !contains($${currentConfig}.libraries._KEYS_, $$lib): \ error("Unknown library object $${lib} in expression '$${1}'.") qtConfHandleLibrary($$lib) - !defined(config.libraries.$${lib}.$${var}, var): \ - var = sources.$$eval(config.libraries.$${lib}.$${source}).$$var - result = $$eval(config.libraries.$${lib}.$${var}) + !defined($${currentConfig}.libraries.$${lib}.$${var}, var): \ + var = sources.$$eval($${currentConfig}.libraries.$${lib}.$${source}).$$var + result = $$eval($${currentConfig}.libraries.$${lib}.$${var}) } else: contains(e, "^features\..*") { feature = $$section(e, ".", 1, 1) var = $$section(e, ".", 2, -1) isEmpty(var): \ var = available - !contains(config.features._KEYS_, $$feature): \ + !contains($${currentConfig}.features._KEYS_, $$feature) { + # this is basically a copy of what qtConfig() in qt_build_config.prf + # does, but we produce a nicer error message. + for (module, QMAKE_CONFIG_DEPS) { + contains(QT.$${module}.enabled_features, $$feature): \ + result = true + else: contains(QT.$${module}.disabled_features, $$feature): \ + result = false + else: \ + next() + !equals(var, available): \ + error("Expression '$$1' is accessing field '$$var' of non-local feature $${feature}.") + return($$result) + } error("Unknown feature object $${feature} in expression '$${1}'.") + } !qtConfCheckFeature($$feature): \ error("Expression '$$1' is accessing non-emitted feature $${feature}.") - result = $$eval(config.features.$${feature}.$${var}) + result = $$eval($${currentConfig}.features.$${feature}.$${var}) } else: contains(e, "^config\..*") { var = $$replace(e, "^config\.", "") result = false @@ -1059,7 +1089,7 @@ defineReplace(qtConfEvaluateSubExpression) { } defineReplace(qtIsFeatureEnabled) { - enable = $$eval(config.features.$${1}.enable) + enable = $$eval($${currentConfig}.features.$${1}.enable) !isEmpty(enable) { $$qtConfEvaluate($$enable): \ return(true) @@ -1072,7 +1102,7 @@ defineReplace(qtIsFeatureEnabled) { } defineReplace(qtIsFeatureDisabled) { - disable = $$eval(config.features.$${1}.disable) + disable = $$eval($${currentConfig}.features.$${1}.disable) !isEmpty(disable) { $$qtConfEvaluate($$disable): \ return(true) @@ -1100,7 +1130,7 @@ defineReplace(qtConfCheckSingleCondition) { } defineTest(qtConfCheckFeature) { - fpfx = config.features.$${1} + fpfx = $${currentConfig}.features.$${1} available = $$eval($${fpfx}.available) !isEmpty(available): return(true) @@ -1138,7 +1168,7 @@ defineTest(qtConfCheckFeature) { $${fpfx}.available = $$result export($${fpfx}.available) - for (i, config.features.$${feature}.output._KEYS_): \ + for (i, $${currentConfig}.features.$${feature}.output._KEYS_): \ qtConfProcessOneOutput($$feature, $$i) return(true) @@ -1146,7 +1176,7 @@ defineTest(qtConfCheckFeature) { defineTest(qtConfProcessFeatures) { - for (feature, config.features._KEYS_): \ + for (feature, $${currentConfig}.features._KEYS_): \ qtConfCheckFeature($$feature) } @@ -1167,8 +1197,8 @@ defineTest(qtConfReportPadded) { defineReplace(qtConfCollectFeatures) { l = for (feature, $$list($${1})) { - $$eval(config.features.$${feature}.available): \ - l += $$eval(config.features.$${feature}.description) + $$eval($${currentConfig}.features.$${feature}.available): \ + l += $$eval($${currentConfig}.features.$${feature}.description) } isEmpty(l): return("") @@ -1181,10 +1211,10 @@ defineTest(qtConfReport_featureList) { defineReplace(qtConfFindFirstAvailableFeature) { for (feature, $$list($${1})) { - isEmpty(config.features.$${feature}._KEYS_): \ + isEmpty($${currentConfig}.features.$${feature}._KEYS_): \ error("Asking for a report on undefined feature $${2}.") - $$eval(config.features.$${feature}.available): \ - return($$eval(config.features.$${feature}.description)) + $$eval($${currentConfig}.features.$${feature}.available): \ + return($$eval($${currentConfig}.features.$${feature}.description)) } return("") @@ -1195,14 +1225,14 @@ defineTest(qtConfReport_firstAvailableFeature) { } defineTest(qtConfReport_feature) { - !contains(config.features._KEYS_, $$2): \ + !contains($${currentConfig}.features._KEYS_, $$2): \ error("Asking for a report on undefined feature $${2}.") # hide report for not emitted features - isEmpty(config.features.$${2}.available): \ + isEmpty($${currentConfig}.features.$${2}.available): \ return() - $$eval(config.features.$${2}.available) { + $$eval($${currentConfig}.features.$${2}.available) { result = "yes" !isEmpty(3): result = "$${3}" } else { @@ -1210,7 +1240,7 @@ defineTest(qtConfReport_feature) { !isEmpty(4): result = "$${4}" } - text = $$eval(config.features.$${2}.description) + text = $$eval($${currentConfig}.features.$${2}.description) qtConfReportPadded($${1}$$text, $$result) } @@ -1270,17 +1300,15 @@ defineTest(qtConfCreateReportRecurse) { } defineTest(qtConfProcessEarlyChecks) { - qtConfCreateReportRecurse(config.earlyReport, false) - qtConfCheckErrors() + qtConfCreateReportRecurse($${currentConfig}.earlyReport, false) } - defineTest(qtConfCreateReport) { - qtConfCreateReportRecurse(config.report, false) + qtConfCreateReportRecurse($${currentConfig}.report, false) } defineTest(qtConfCreateSummary) { - qtConfCreateReportRecurse(config.summary, "") + qtConfCreateReportRecurse($${currentConfig}.summary, "") } defineTest(qtConfPrintReport) { @@ -1322,15 +1350,6 @@ defineTest(qtConfCheckErrors) { # output generation # -defineReplace(qtConfOutputSelectProFile) { - !isEmpty($${1}.public) { - $$eval($${1}.public): \ - return(publicPro) - } - return(privatePro) -} - - # qtConfOutputVar(modifier, output, name, value) defineTest(qtConfOutputVar) { modifier = $$1 @@ -1338,35 +1357,53 @@ defineTest(qtConfOutputVar) { name = $$3 value = $$val_escape(4) - !isEmpty(config.output.$${output}.assign.$${name}): \ + defined($${currentConfig}.output.$${output}.assign.$${name}, var): \ error("Trying to overwrite assigned variable '$$name' in '$$output' using modifier '$$modifier'.") equals(modifier, assign) { - !isEmpty(config.output.$${output}.append.$${name})|!isEmpty(config.output.$${output}.remove.$${name}): \ + !isEmpty($${currentConfig}.output.$${output}.append.$${name})|!isEmpty($${currentConfig}.output.$${output}.remove.$${name}): \ error("Trying to assign variable '$$name' in '$$output', which has already appended or removed parts.") - config.output.$${output}.assign.$${name} = $$value + $${currentConfig}.output.$${output}.assign.$${name} = $$value } else: equals(modifier, append) { - contains(config.output.$${output}.remove.$${name}, $$value): \ + contains($${currentConfig}.output.$${output}.remove.$${name}, $$value): \ error("Trying to append removed '$$value' to variable '$$name' in '$$output'.") - config.output.$${output}.append.$${name} += $$value + $${currentConfig}.output.$${output}.append.$${name} += $$value } else: equals(modifier, remove) { - contains(config.output.$${output}.append.$${name}, $$value): \ + contains($${currentConfig}.output.$${output}.append.$${name}, $$value): \ error("Trying to remove appended '$$value' to variable '$$name' in '$$output'.") - config.output.$${output}.remove.$${name} += $$value + $${currentConfig}.output.$${output}.remove.$${name} += $$value } else { error("Invalid modifier '$$modifier' passed to qtConfOutputVar.") } - config.output.$${output}.$${modifier}._KEYS_ *= $${name} - export(config.output.$${output}.$${modifier}.$${name}) - export(config.output.$${output}.$${modifier}._KEYS_) + $${currentConfig}.output.$${output}.$${modifier}._KEYS_ *= $${name} + export($${currentConfig}.output.$${output}.$${modifier}.$${name}) + export($${currentConfig}.output.$${output}.$${modifier}._KEYS_) +} + +# qtConfExtendVar(output, name, value) +defineTest(qtConfExtendVar) { + output = $$1 + name = $$2 + value = $$val_escape(3) + + !defined($${currentConfig}.output.$${output}.assign.$${name}, var): \ + error("Trying to extend undefined variable '$$name' in '$$output'.") + + $${currentConfig}.output.$${output}.assign.$${name} += $$value + export($${currentConfig}.output.$${output}.assign.$${name}) } defineTest(qtConfOutputVarHelper) { + !isEmpty($${2}.public):$$eval($${2}.public) { + output = "publicPro" + } else { + output = "privatePro" + } + negative = $$eval($${2}.negative) isEmpty(negative): negative = false equals(3, $$negative): return() - output = $$qtConfOutputSelectProFile($${2}) name = $$eval($${2}.name) isEmpty(name): \ error("Output type 'var$$title($$1)' used in feature '$$eval($${2}.feature)' without a 'name' entry.") @@ -1375,6 +1412,8 @@ defineTest(qtConfOutputVarHelper) { !isEmpty($${2}.eval):$$qtConfEvaluate($$eval($${2}.eval)): \ eval(value = $$value) qtConfOutputVar($$1, $$output, $$name, $$value) + equals(output, "publicPro"):!isEmpty($${currentConfig}.module): \ + qtConfExtendVar($$output, "QT.$${currentModule}.exports", $$name) } defineTest(qtConfOutput_varAssign) { @@ -1392,6 +1431,8 @@ defineTest(qtConfOutput_varRemove) { defineTest(qtConfOutputConfigVar) { pro = $$3 var = $$4 + modular = $$5 + negative = $$eval($${1}.negative) isEmpty(negative): negative = false equals(2, $$negative): return() @@ -1402,26 +1443,31 @@ defineTest(qtConfOutputConfigVar) { $$negative: val = no-$$val } - qtConfOutputVar(append, $$pro, $$var, $$val) + isEmpty($${currentConfig}.module)|!$$modular: \ + qtConfOutputVar(append, $$pro, $$var, $$val) + else: \ + qtConfExtendVar($$pro, "QT.$${currentModule}.$$var", $$val) } defineTest(qtConfOutput_publicQtConfig) { - qtConfOutputConfigVar($$1, $$2, "publicPro", "QT_CONFIG") + qtConfOutputConfigVar($$1, $$2, "publicPro", "QT_CONFIG", true) } defineTest(qtConfOutput_publicConfig) { - qtConfOutputConfigVar($$1, $$2, "publicPro", "CONFIG") + !isEmpty($${currentConfig}.module): \ + error("Cannot use output type 'publicConfig' in module-local feature '$$eval($${1}.feature)'.") + qtConfOutputConfigVar($$1, $$2, "publicPro", "CONFIG", false) } defineTest(qtConfOutput_privateConfig) { - qtConfOutputConfigVar($$1, $$2, "privatePro", "CONFIG") + qtConfOutputConfigVar($$1, $$2, "privatePro", "CONFIG", false) } defineTest(qtConfOutputSetDefine) { - config.output.$${1}.$${2} = $${3} - config.output.$${1}._KEYS_ *= $${2} - export(config.output.$${1}.$${2}) - export(config.output.$${1}._KEYS_) + $${currentConfig}.output.$${1}.$${2} = $${3} + $${currentConfig}.output.$${1}._KEYS_ *= $${2} + export($${currentConfig}.output.$${1}.$${2}) + export($${currentConfig}.output.$${1}._KEYS_) } defineTest(qtConfOutput_define) { @@ -1444,13 +1490,35 @@ defineTest(qtConfOutput_feature) { name = $$eval($${1}.feature) $${2} { - qtConfOutputVar(append, "publicPro", "QT_CONFIG", $$name) + isEmpty($${currentConfig}.module): \ + qtConfOutputVar(append, "publicPro", "QT_CONFIG", $$name) + else: \ + qtConfExtendVar("publicPro", "QT.$${currentModule}.QT_CONFIG", $$name) } else { f = $$upper($$replace(name, -, _)) qtConfOutputSetDefine("publicHeader", "QT_NO_$$f") } } +defineTest(qtConfSetModuleName) { + currentModule = $$eval($${currentConfig}.module) + isEmpty(currentModule): \ + currentModule = global + export(currentModule) +} + +defineTest(qtConfSetupModuleOutputs) { + qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.enabled_features", ) + qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.disabled_features", ) + qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}_private.enabled_features", ) + qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}_private.disabled_features", ) + !isEmpty($${currentConfig}.module) { + qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.QT_CONFIG", ) + qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.exports", ) + qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}_private.libraries", ) + } +} + defineTest(qtConfOutput_publicFeature) { name = "$$eval($${1}.name)" isEmpty(name): \ @@ -1458,10 +1526,14 @@ defineTest(qtConfOutput_publicFeature) { feature = $$replace(name, [-+.], _) $${2} { - qtConfOutputVar(append, "publicPro", "QT.global.enabled_features", $$name) + qtConfExtendVar("publicPro", "QT.$${currentModule}.enabled_features", $$name) + QT.$${currentModule}.enabled_features += $$name + export(QT.$${currentModule}.enabled_features) qtConfOutputSetDefine("publicHeader", "QT_FEATURE_$$feature", 1) } else { - qtConfOutputVar(append, "publicPro", "QT.global.disabled_features", $$name) + qtConfExtendVar("publicPro", "QT.$${currentModule}.disabled_features", $$name) + QT.$${currentModule}.disabled_features += $$name + export(QT.$${currentModule}.disabled_features) qtConfOutputSetDefine("publicHeader", "QT_FEATURE_$$feature", -1) } } @@ -1476,17 +1548,21 @@ defineTest(qtConfOutput_privateFeature) { feature = $$replace(name, [-+.], _) $${2} { - qtConfOutputVar(append, "privatePro", "QT.global.enabled_features", $$name) + qtConfExtendVar("privatePro", "QT.$${currentModule}_private.enabled_features", $$name) + QT.$${currentModule}_private.enabled_features += $$name + export(QT.$${currentModule}_private.enabled_features) qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", 1) } else { - qtConfOutputVar(append, "privatePro", "QT.global.disabled_features", $$name) + qtConfExtendVar("privatePro", "QT.$${currentModule}_private.disabled_features", $$name) + QT.$${currentModule}_private.disabled_features += $$name + export(QT.$${currentModule}_private.disabled_features) qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", -1) } } defineTest(qtConfProcessOneOutput) { feature = $${1} - fpfx = config.features.$${feature} + fpfx = $${currentConfig}.features.$${feature} opfx = $${fpfx}.output.$${2} condition = $$eval($${opfx}.condition) @@ -1512,64 +1588,167 @@ defineTest(qtConfProcessOneOutput) { } defineTest(qtConfProcessOutput) { + !contains($${currentConfig}._KEYS_, "features"): \ + return() + + basedir = $$shadowed($$eval($${currentConfig}.dir)) + module = $$eval($${currentConfig}.module) + # write it to the output files - for (type, config.files._KEYS_) { - file = $$OUT_PWD/$$eval(config.files.$${type}) + isEmpty($${currentConfig}.files._KEYS_) { + # set defaults that should work for most Qt modules + isEmpty(module): \ + error("Neither module nor files section specified in configuration file.") + + $${currentConfig}.files._KEYS_ = publicPro privatePro publicHeader privateHeader + $${currentConfig}.files.publicPro = qt$${module}-config.pri + $${currentConfig}.files.privatePro = qt$${module}-config.pri # sic! + $${currentConfig}.files.publicHeader = qt$${module}-config.h + $${currentConfig}.files.privateHeader = qt$${module}-config_p.h + } + + for (type, $${currentConfig}.files._KEYS_) { contains(type, ".*Pro") { - for (k, config.output.$${type}.assign._KEYS_): \ - config.output.$$type += "$$k = $$eval(config.output.$${type}.assign.$$k)" - for (k, config.output.$${type}.remove._KEYS_): \ - config.output.$$type += "$$k -= $$eval(config.output.$${type}.remove.$$k)" - for (k, config.output.$${type}.append._KEYS_): \ - config.output.$$type += "$$k += $$eval(config.output.$${type}.append.$$k)" + for (k, $${currentConfig}.output.$${type}.assign._KEYS_): \ + $${currentConfig}.output.$$type += "$$k = $$eval($${currentConfig}.output.$${type}.assign.$$k)" + for (k, $${currentConfig}.output.$${type}.remove._KEYS_): \ + $${currentConfig}.output.$$type += "$$k -= $$eval($${currentConfig}.output.$${type}.remove.$$k)" + for (k, $${currentConfig}.output.$${type}.append._KEYS_): \ + $${currentConfig}.output.$$type += "$$k += $$eval($${currentConfig}.output.$${type}.append.$$k)" } else { - for (define, config.output.$${type}._KEYS_) { - value = $$eval(config.output.$${type}.$${define}) - config.output.$$type += "$${LITERAL_HASH}define $$define $$value" + for (define, $${currentConfig}.output.$${type}._KEYS_) { + value = $$eval($${currentConfig}.output.$${type}.$${define}) + $${currentConfig}.output.$$type += "$${LITERAL_HASH}define $$define $$value" } } - defined(qtConfOutputPostProcess_$${type}, test): \ - qtConfOutputPostProcess_$${type}() - write_file($$file, config.output.$${type})|error() + ppScope = + !isEmpty(module): ppScope = $${module}_ + defined(qtConfOutputPostProcess_$${ppScope}$${type}, test): \ + qtConfOutputPostProcess_$${ppScope}$${type}() + + file = $$eval($${currentConfig}.files.$${type}) + fileCont.$$file += $$eval($${currentConfig}.output.$${type}) + fileCont._KEYS_ *= $$file } + + for (file, fileCont._KEYS_): \ + write_file($$basedir/$$file, fileCont.$$file)|error() } # # tie it all together # -defineTest(qtConfigure) { +cfgs = +isEmpty(_QMAKE_SUPER_CACHE_)|equals(OUT_PWD, $$dirname(_QMAKE_SUPER_CACHE_)) { + c = $$basename(_PRO_FILE_PWD_) + config.$${c}.dir = $$_PRO_FILE_PWD_ + cfgs += $$c + !isEmpty(_QMAKE_SUPER_CACHE_) { + for (s, SUBDIRS) { + config.$${s}.dir = $$_PRO_FILE_PWD_/$${s} + cfgs += $$s + } + } +} +configsToProcess = +for (c, cfgs) { + s = $$eval(config.$${c}.dir) + exists($$s/configure.json): \ + configsToProcess += $$c +} +isEmpty(configsToProcess): \ + return() + +load(configure_base) + +QMAKE_POST_CONFIGURE = +allConfigs = +for(ever) { + isEmpty(configsToProcess): \ + break() + + currentConfig = config.$$take_first(configsToProcess) + thisDir = $$eval($${currentConfig}.dir) + jsonFile = $$thisDir/configure.json + priFile = $$thisDir/configure.pri + + allConfigs += $$currentConfig + # load configuration data - configure_data = $$cat($${1}, blob) - !parseJson(configure_data, config): \ - error("Invalid or non-existent file $${1}.") + configure_data = $$cat($$jsonFile, blob) + !parseJson(configure_data, $$currentConfig): \ + error("Invalid or non-existent file $${jsonFile}.") + exists($$priFile): \ + !include($$priFile): error() + + # prepend all subconfigs to files to keep a depth first search order + subconfigs = + for(n, $${currentConfig}.subconfigs._KEYS_) { + subconfig = $$eval($${currentConfig}.subconfigs.$${n}) + name = $$basename(subconfig) + config.$${name}.dir = $$thisDir/$$subconfig + subconfigs += $$name + } + configsToProcess = $$subconfigs $$configsToProcess +} +for (currentConfig, allConfigs): \ qtConfSetupLibraries() - qtConfSetupTestTypeDeps() - qtConfParseCommandLine() +!isEmpty(_QMAKE_SUPER_CACHE_): \ + QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache +else: \ + QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache +QMAKE_CONFIG_CACHE_USE = all - !equals(QMAKE_CONFIG_CACHE_USE, none) { - include($$QMAKE_CONFIG_CACHE, , true) - # this crudely determines when to discard the cache. this also catches the case - # of no cache being there in the first place. - !equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]): \ - QMAKE_CONFIG_CACHE_USE = none - } - equals(QMAKE_CONFIG_CACHE_USE, none) { - cont = \ - "cache.platform = $$[QMAKE_SPEC]" \ - "cache.xplatform = $$[QMAKE_XSPEC]" - write_file($$QMAKE_CONFIG_CACHE, cont) - } +qtConfParseCommandLine() + +!equals(QMAKE_CONFIG_CACHE_USE, none) { + include($$QMAKE_CONFIG_CACHE, , true) + # this crudely determines when to discard the cache. this also catches the case + # of no cache being there in the first place. + !equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]): \ + QMAKE_CONFIG_CACHE_USE = none +} +equals(QMAKE_CONFIG_CACHE_USE, none) { + cont = \ + "cache.platform = $$[QMAKE_SPEC]" \ + "cache.xplatform = $$[QMAKE_XSPEC]" + write_file($$QMAKE_CONFIG_CACHE, cont) +} +for (currentConfig, allConfigs) { + qtConfSetModuleName() + qtConfSetupModuleOutputs() # do early checks, mainly to validate the command line qtConfProcessEarlyChecks() +} +qtConfCheckErrors() - CONFIG += qt_conf_tests_allowed - logn() - logn("Running configuration tests...") +CONFIG += qt_conf_tests_allowed +logn() +logn("Running configuration tests...") + +for (currentConfig, allConfigs) { + tdir = $$eval($${currentConfig}.testDir) + isEmpty(tdir): tdir = config.tests + QMAKE_CONFIG_TESTS_DIR = $$absolute_path($$tdir, $$eval($${currentConfig}.dir)) + + qtConfSetModuleName() + + qtConfSetupTestTypeDeps() + + # correctly setup dependencies + QMAKE_CONFIG_DEPS = global global_private + !isEmpty($${currentConfig}.module) { + for (d, $${currentConfig}.depends._KEYS_) { + dep = $$replace($${currentConfig}.depends.$$d, -private$, _private) + dep *= $$replace(dep, _private$, ) + QMAKE_CONFIG_DEPS += $$dep + } + } # process all features qtConfProcessFeatures() @@ -1578,14 +1757,15 @@ defineTest(qtConfigure) { qtConfProcessOutput() qtConfCreateReport() qtConfCreateSummary() - - logn("Done running configuration tests.") - logn() } -qtConfigure($$_PRO_FILE_PWD_/configure.json) +# these come from the pri files loaded above. +for (p, QMAKE_POST_CONFIGURE): \ + eval($$p) -logn("Configure summary:") +logn("Done running configuration tests.") logn() +logn("Configure summary:") +logn() qtConfPrintReport() diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 735ece45f2..efbf2fab1d 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -300,10 +300,16 @@ defineTest(prepareRecursiveTarget) { } defineTest(qtConfig) { - contains(QT.global.enabled_features, $$1): \ - return(true) - contains(QT.global.disabled_features, $$1): \ - return(false) - + modules = $$QT $$QT_PRIVATE $$QT_FOR_CONFIG + modules ~= s,-private$,_private,g + modules = $$resolve_depends(modules, "QT.", ".depends") + modules += global global_private + modules = $$reverse(modules) + for (module, modules) { + contains(QT.$${module}.enabled_features, $$1): \ + return(true) + contains(QT.$${module}.disabled_features, $$1): \ + return(false) + } error("Could not find feature $${1}.") } diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 9e0b21903f..229760068e 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -106,6 +106,16 @@ alien_syncqt: return() MODULE_INC_OUTDIR = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME +exists($$OUT_PWD/qt$${MODULE}-config.h) { + fwd_rel = $$relative_path($$OUT_PWD, $$MODULE_INC_OUTDIR) + SYNCQT.INJECTIONS += \ + $$fwd_rel/qt$${MODULE}-config.h:qt$${MODULE}-config.h \ + $$fwd_rel/qt$${MODULE}-config_p.h:$$MODULE_VERSION/$$MODULE_INCNAME/private/qt$${MODULE}-config_p.h + inst_rel = $$relative_path($$OUT_PWD, $$_PRO_FILE_PWD_) + SYNCQT.HEADER_FILES += $$inst_rel/qt$${MODULE}-config.h + SYNCQT.PRIVATE_HEADER_FILES += $$inst_rel/qt$${MODULE}-config_p.h +} + for (injection, SYNCQT.INJECTIONS) { injects = $$split(injection, :) dst_hdr = $$absolute_path($$member(injects, 0), $$MODULE_INC_OUTDIR) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index b67a56c7d5..9542a362d0 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -35,6 +35,41 @@ else: \ MODULE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE_ID}.pri MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri +exists($$OUT_PWD/qt$${MODULE}-config.pri): \ + include($$OUT_PWD/qt$${MODULE}-config.pri) + +defineReplace(qtGetFeaturesForModule) { + enabled = $$unique(QT.$${1}.enabled_features) + disabled = $$unique(QT.$${1}.disabled_features) + result = \ + "QT.$${1}.enabled_features =$$join(enabled, " ", " ")" \ + "QT.$${1}.disabled_features =$$join(disabled, " ", " ")" + return($$result) +} + +defineReplace(qtGetExportsForModule) { + result = + for (var, QT.$${1}.exports): \ + result += "$$var = $$val_escape($$var)" + return($$result) +} + +defineReplace(qtExportLibsForModule) { + result = + for (lib, QT.$${1}.libraries) { + NAME = $$upper($$lib) + vars = \ + QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \ + QMAKE_CFLAGS_$$NAME QMAKE_INCDIR_$$NAME QMAKE_$${NAME}_VERSION \ + QMAKE_$${NAME}_VERSION_MAJOR QMAKE_$${NAME}_VERSION_MINOR QMAKE_$${NAME}_VERSION_PATCH + for (var, vars) { + !isEmpty($$var): \ + result += "$$var = $$val_escape($$var)" + } + } + return($$result) +} + !build_pass { # Create a module .pri file @@ -102,6 +137,9 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri "QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \ $$module_config \ "QT.$${MODULE_ID}.DEFINES = $$val_escape(MODULE_DEFINES)" \ + $$qtGetFeaturesForModule($$MODULE_ID) \ + $$qtGetExportsForModule($$MODULE_ID) \ + "QT_CONFIG +=$$join(QT.$${MODULE_ID}.QT_CONFIG, " ", " ")" \ "" \ "QT_MODULES += $$MODULE" winrt: MODULE_PRI_CONT += \ @@ -126,7 +164,10 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri "QT.$${MODULE}_private.includes = $$MODULE_PRIVATE_INCLUDES" \ "QT.$${MODULE}_private.frameworks =" \ "QT.$${MODULE}_private.depends = $$private_deps" \ - "QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")" + "QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")" \ + $$qtGetFeaturesForModule($${MODULE}_private) \ + "" \ + $$qtExportLibsForModule($${MODULE}_private) write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error() } MODULE_PRI_FILES = $$MODULE_PRI $$MODULE_PRIVATE_PRI diff --git a/mkspecs/features/qt_parts.prf b/mkspecs/features/qt_parts.prf index fa62f40e35..0accef6665 100644 --- a/mkspecs/features/qt_parts.prf +++ b/mkspecs/features/qt_parts.prf @@ -12,6 +12,8 @@ # Ensure that each module has a .qmake.cache when properly qmake'd. cache() +load(qt_configure) + load(qt_build_config) TEMPLATE = subdirs @@ -74,6 +76,7 @@ QT_BUILD_PARTS -= libs tools examples tests QMAKE_DISTCLEAN += \ .qmake.cache \ + config.cache \ config.log \ mkspecs/modules/*.pri \ mkspecs/modules-inst/*.pri -- cgit v1.2.3 From 103ffa117d3008cf0f73437aa09c1550ea799576 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 9 Sep 2016 09:29:57 +0200 Subject: Add a spec for NXP Colibri VF50/61 Change-Id: I12450a214d61ffa00270095df0c77e57647d7a2c Reviewed-by: Andy Nichols --- mkspecs/devices/linux-colibri-vf-g++/qmake.conf | 17 +++++++++ .../devices/linux-colibri-vf-g++/qplatformdefs.h | 40 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 mkspecs/devices/linux-colibri-vf-g++/qmake.conf create mode 100644 mkspecs/devices/linux-colibri-vf-g++/qplatformdefs.h (limited to 'mkspecs') diff --git a/mkspecs/devices/linux-colibri-vf-g++/qmake.conf b/mkspecs/devices/linux-colibri-vf-g++/qmake.conf new file mode 100644 index 0000000000..bc42f67f8a --- /dev/null +++ b/mkspecs/devices/linux-colibri-vf-g++/qmake.conf @@ -0,0 +1,17 @@ +# +# qmake configuration for the NXP Colibri VFxx boards +# + +include(../common/linux_device_pre.conf) + +VFXX_CFLAGS = -march=armv7-a -mtune=cortex-a5 -mfpu=neon +QMAKE_CFLAGS += $$VFXX_CFLAGS +QMAKE_CXXFLAGS += $$VFXX_CFLAGS + +QT_QPA_DEFAULT_PLATFORM = linuxfb + +DISTRO_OPTS += hard-float + +include(../common/linux_arm_device_post.conf) + +load(qt_config) diff --git a/mkspecs/devices/linux-colibri-vf-g++/qplatformdefs.h b/mkspecs/devices/linux-colibri-vf-g++/qplatformdefs.h new file mode 100644 index 0000000000..6a35ed45d5 --- /dev/null +++ b/mkspecs/devices/linux-colibri-vf-g++/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 "../../linux-g++/qplatformdefs.h" -- cgit v1.2.3 From 2d3c73fcfe7a93cb46190e8e82410fe93145dbe0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 9 Sep 2016 09:50:08 +0200 Subject: Modularize configure.json/.pri Move the different parts of configure.json/.pri into the libraries where they belong. Gui is not yet fully modularized, and contains many things related to the different QPA plugins. Done-with: Oswald Buddenhagen Change-Id: I6659bb29354ed1f36b95b8c69e7fce58f642053f Reviewed-by: Lars Knoll --- mkspecs/features/ctest_testcase_common.prf | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs') diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf index 40e41900e8..af80fc00a1 100644 --- a/mkspecs/features/ctest_testcase_common.prf +++ b/mkspecs/features/ctest_testcase_common.prf @@ -69,6 +69,7 @@ for (dep, dependentmodules): \ mod_deps += $$cmakeModuleName($$dep) 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 -- cgit v1.2.3 From b754b2815d342334f335816b901c051940954942 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 26 Aug 2016 21:10:56 +0200 Subject: rename description => label in configure.json "description" suggests something slightly longer. this may seem like a gratuitous change, but the upcoming replacement of the old feature system clarifies makes it seem much less so. Change-Id: Ibe702e01cb146b59127bf1f990b4acaef1c61d55 Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 79fede1525..af8a0e259d 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -777,17 +777,17 @@ defineTest(logn) { } defineTest(qtLogTestIntro) { - description = $$eval($${1}.description) - isEmpty(description): return() + label = $$eval($${1}.label) + isEmpty(label): return() - msg = "Checking for $${description}... " + msg = "Checking for $${label}... " log($$msg) $$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)") write_file($$QMAKE_CONFIG_LOG, msg, append) } defineTest(qtLogTestResult) { - isEmpty($${1}.description): return() + isEmpty($${1}.label): return() !isEmpty($${1}.log) { field = $$eval($${1}.log) @@ -1198,7 +1198,7 @@ defineReplace(qtConfCollectFeatures) { l = for (feature, $$list($${1})) { $$eval($${currentConfig}.features.$${feature}.available): \ - l += $$eval($${currentConfig}.features.$${feature}.description) + l += $$eval($${currentConfig}.features.$${feature}.label) } isEmpty(l): return("") @@ -1214,7 +1214,7 @@ defineReplace(qtConfFindFirstAvailableFeature) { isEmpty($${currentConfig}.features.$${feature}._KEYS_): \ error("Asking for a report on undefined feature $${2}.") $$eval($${currentConfig}.features.$${feature}.available): \ - return($$eval($${currentConfig}.features.$${feature}.description)) + return($$eval($${currentConfig}.features.$${feature}.label)) } return("") @@ -1240,7 +1240,7 @@ defineTest(qtConfReport_feature) { !isEmpty(4): result = "$${4}" } - text = $$eval($${currentConfig}.features.$${2}.description) + text = $$eval($${currentConfig}.features.$${2}.label) qtConfReportPadded($${1}$$text, $$result) } -- cgit v1.2.3 From a668c6a6b605ce516f71b9339df53699e85ad248 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 26 Aug 2016 21:19:12 +0200 Subject: Convert the old feature system ... to the new qmake based configuration system. This removes the old qfeatures.txt (distributed over configure.json files) and qfeatures.h (distributed over qconfig-.h files). qfeatures.prf is gone without replacement, as attempts to use it would lead to followup errors anyway. Change-Id: I1598de19db937082283a905b9592d3849d2199d0 Reviewed-by: Oswald Buddenhagen --- mkspecs/common/linux-android.conf | 1 - mkspecs/common/uikit.conf | 2 +- mkspecs/common/winrt_winphone/qmake.conf | 3 +-- mkspecs/features/qfeatures.prf | 4 ---- mkspecs/features/qt_configure.prf | 16 ++++++++++++++-- mkspecs/integrity-armv7-imx6/qmake.conf | 1 - mkspecs/integrity-armv7/qmake.conf | 1 - mkspecs/integrity-x86/qmake.conf | 1 - mkspecs/qnx-aarch64le-qcc/qmake.conf | 2 +- mkspecs/qnx-armle-v7-qcc/qmake.conf | 2 -- mkspecs/qnx-x86-64-qcc/qmake.conf | 2 -- mkspecs/qnx-x86-qcc/qmake.conf | 2 -- 12 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 mkspecs/features/qfeatures.prf (limited to 'mkspecs') diff --git a/mkspecs/common/linux-android.conf b/mkspecs/common/linux-android.conf index fec008cb45..b8e052d1ec 100644 --- a/mkspecs/common/linux-android.conf +++ b/mkspecs/common/linux-android.conf @@ -6,7 +6,6 @@ QMAKE_PLATFORM += android include(linux.conf) include(gcc-base-unix.conf) -DEFINES += QT_NO_PRINTER QT_NO_PRINTDIALOG QT_QPA_DEFAULT_PLATFORM = minimal NDK_ROOT = $$(ANDROID_NDK_ROOT) diff --git a/mkspecs/common/uikit.conf b/mkspecs/common/uikit.conf index edc0eddf00..bfbab36db6 100644 --- a/mkspecs/common/uikit.conf +++ b/mkspecs/common/uikit.conf @@ -6,6 +6,6 @@ QMAKE_PLATFORM += uikit CONFIG += bitcode reduce_exports INCLUDEPATH += $$PWD/uikit -DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG +DEFINES += DARWIN_NO_CARBON include(mac.conf) diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index b5e0c7cc71..05c9bd39a5 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -10,8 +10,7 @@ MAKEFILE_GENERATOR = MSBUILD QMAKE_COMPILER = msvc QMAKE_PLATFORM = winrt win32 CONFIG = package_manifest $$CONFIG incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target rtti -DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN \ - QT_NO_PRINTER QT_NO_PRINTDIALOG # TODO: Remove when printing is re-enabled +DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN DEPLOYMENT_PLUGIN += qwinrt diff --git a/mkspecs/features/qfeatures.prf b/mkspecs/features/qfeatures.prf deleted file mode 100644 index 15ef5c5be0..0000000000 --- a/mkspecs/features/qfeatures.prf +++ /dev/null @@ -1,4 +0,0 @@ -# This file needs to be loaded explicitly, as the evaluation is relatively -# expensive, and not many projects will actually need it. -QMAKE_QT_FEATURES = $$[QT_HOST_DATA/get]/mkspecs/qfeatures.pri -include($$QMAKE_QT_FEATURES) | error("Failed to load $$QMAKE_QT_FEATURES") diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index af8a0e259d..e34d7ad194 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -285,8 +285,20 @@ defineTest(qtConfParseCommandLine) { } # handle builtin [-no]-feature-xxx isEmpty(type):contains(opt, "feature-(.*)") { - # simply skip for now - next() + opt ~= s,^feature-,, + found = false + for (cc, allConfigs) { + contains($${cc}.features._KEYS_, $$opt) { + found = true + break() + } + } + !$$found { + qtConfAddError("Enabling/Disabling unknown feature '$$opt'.") + return() + } + # this is a boolean enabling/disabling the corresponding feature + type = boolean } isEmpty(type) { diff --git a/mkspecs/integrity-armv7-imx6/qmake.conf b/mkspecs/integrity-armv7-imx6/qmake.conf index 7a1ee461f2..3bf2abd844 100644 --- a/mkspecs/integrity-armv7-imx6/qmake.conf +++ b/mkspecs/integrity-armv7-imx6/qmake.conf @@ -4,7 +4,6 @@ include(../common/ghs-integrity-armv7.conf) -DEFINES += QT_NO_CLIPBOARD DEFINES += QT_STATICPLUGIN QTPLUGIN.platforms += qeglfs qeglfs-viv-integration diff --git a/mkspecs/integrity-armv7/qmake.conf b/mkspecs/integrity-armv7/qmake.conf index 0cac2ebdc0..7a2ffaba14 100644 --- a/mkspecs/integrity-armv7/qmake.conf +++ b/mkspecs/integrity-armv7/qmake.conf @@ -4,7 +4,6 @@ include(../common/ghs-integrity-armv7.conf) -DEFINES += QT_NO_CLIPBOARD DEFINES += QT_STATICPLUGIN QTPLUGIN.platforms += integrityfb diff --git a/mkspecs/integrity-x86/qmake.conf b/mkspecs/integrity-x86/qmake.conf index 4a5cfcc49d..13d4a6c082 100644 --- a/mkspecs/integrity-x86/qmake.conf +++ b/mkspecs/integrity-x86/qmake.conf @@ -5,7 +5,6 @@ include(../common/ghs-integrity-x86.conf) QMAKE_CFLAGS += -cpu=Corei -DEFINES += QT_NO_CLIPBOARD DEFINES += QT_STATICPLUGIN QTPLUGIN.platforms += integrityfb diff --git a/mkspecs/qnx-aarch64le-qcc/qmake.conf b/mkspecs/qnx-aarch64le-qcc/qmake.conf index 6d72bd459e..5e3123bece 100644 --- a/mkspecs/qnx-aarch64le-qcc/qmake.conf +++ b/mkspecs/qnx-aarch64le-qcc/qmake.conf @@ -2,7 +2,7 @@ # qmake configuration for qnx aarch64le systems # -DEFINES += QT_NO_CLIPBOARD _FORTIFY_SOURCE=2 +DEFINES += _FORTIFY_SOURCE=2 QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now diff --git a/mkspecs/qnx-armle-v7-qcc/qmake.conf b/mkspecs/qnx-armle-v7-qcc/qmake.conf index b77455044c..a21e5bcad3 100644 --- a/mkspecs/qnx-armle-v7-qcc/qmake.conf +++ b/mkspecs/qnx-armle-v7-qcc/qmake.conf @@ -3,5 +3,3 @@ # include(../common/qcc-base-qnx-armle-v7.conf) - -DEFINES += QT_NO_CLIPBOARD diff --git a/mkspecs/qnx-x86-64-qcc/qmake.conf b/mkspecs/qnx-x86-64-qcc/qmake.conf index ebedeceb46..2a01ed1405 100644 --- a/mkspecs/qnx-x86-64-qcc/qmake.conf +++ b/mkspecs/qnx-x86-64-qcc/qmake.conf @@ -2,8 +2,6 @@ # qmake configuration for qnx x86-64 systems # -DEFINES += QT_NO_CLIPBOARD - QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now include(../common/qcc-base-qnx-x86-64.conf) diff --git a/mkspecs/qnx-x86-qcc/qmake.conf b/mkspecs/qnx-x86-qcc/qmake.conf index 36a3ba2ff3..3daadf4f02 100644 --- a/mkspecs/qnx-x86-qcc/qmake.conf +++ b/mkspecs/qnx-x86-qcc/qmake.conf @@ -3,5 +3,3 @@ # include(../common/qcc-base-qnx-x86.conf) - -DEFINES += QT_NO_CLIPBOARD -- cgit v1.2.3