summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/configure.prf3
-rw-r--r--mkspecs/features/create_cmake.prf6
-rw-r--r--mkspecs/features/gcov.prf31
-rw-r--r--mkspecs/features/ios/default_post.prf95
-rw-r--r--mkspecs/features/ios/default_pre.prf2
-rw-r--r--mkspecs/features/ios/qt.prf24
-rw-r--r--mkspecs/features/java.prf9
-rw-r--r--mkspecs/features/qt_common.prf31
-rw-r--r--mkspecs/features/qt_docs.prf2
-rw-r--r--mkspecs/features/qt_functions.prf9
-rw-r--r--mkspecs/features/simd.prf3
-rw-r--r--mkspecs/features/spec_post.prf10
12 files changed, 144 insertions, 81 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index b4569df6d5..39144e7216 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -7,9 +7,6 @@ equals(MAKEFILE_GENERATOR, UNIX) {
QMAKE_MAKE = mingw32-make
} else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) {
QMAKE_MAKE = nmake
-} else:ios {
- # iOS unsets MAKEFILE_GENERATOR in its default_pre.prf
- QMAKE_MAKE = make
} else {
error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.")
}
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index d8bef46481..59c3fafac3 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -60,12 +60,6 @@ contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
}
-CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX])
-contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") {
- CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA]/
- CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = True
-}
-
static|staticlib:CMAKE_STATIC_TYPE = true
CMAKE_DEBUG_TYPE =
diff --git a/mkspecs/features/gcov.prf b/mkspecs/features/gcov.prf
new file mode 100644
index 0000000000..330831fc0e
--- /dev/null
+++ b/mkspecs/features/gcov.prf
@@ -0,0 +1,31 @@
+#
+# Tested with gcov 4.8.1
+# http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Gcov.html
+
+# To instrument a Qt application or library with the gcov coverage
+# tool, do `CONFIG+=gcov' in the application .pro file.
+#
+# To instrument Qt itself with gcov, use the `-gcov' configure
+# option.
+
+# The .gcno file is generated when the source file is compiled.
+# The .gcda file is generated when a program is executed.
+
+# Example how to generate the html output after you've run the program or test
+#
+# lcov --capture --directory . --output-file coverage-gcov.info --no-external
+# lcov --output-file coverage-gcov.info --remove coverage-gcov.info '*.moc*' '.*rcc*' '*3rdparty*'
+# genhtml coverage-gcov.info --output-directory doc/coverage
+
+# If you want to use gcov directly, you most likely need to manually move the .gcda and .gcno files
+# along with the program.
+#
+# mv .obj/debug-shared/tst_example.gc* .
+# gcov -b -c tst_example.cpp
+
+QMAKE_CFLAGS += -fprofile-arcs -ftest-coverage
+QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
+QMAKE_OBJECTIVE_CFLAGS += -fprofile-arcs -ftest-coverage
+QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
+
+QMAKE_CLEAN += $(OBJECTS_DIR)*.gcno and $(OBJECTS_DIR)*.gcda
diff --git a/mkspecs/features/ios/default_post.prf b/mkspecs/features/ios/default_post.prf
index e9d2149351..654255eb1f 100644
--- a/mkspecs/features/ios/default_post.prf
+++ b/mkspecs/features/ios/default_post.prf
@@ -1,40 +1,44 @@
-CONFIG(qt):contains(QT, gui):equals(TEMPLATE, app): CONFIG += gui_app
+equals(TEMPLATE, app) {
+ qt:app_bundle:!macx-xcode {
+ # For Qt applications we want Xcode project files as the generated output,
+ # but since qmake doesn't handle the transition between makefiles and Xcode
+ # project files (which happens when using subdirs), we create a wrapper
+ # makefile that takes care of generating the Xcode project, and allows
+ # building by calling out to xcodebuild.
+ TEMPLATE = aux
-isEmpty(MAKEFILE_GENERATOR) {
- gui_app:app_bundle: \
- # For applications we want Xcode project files
- MAKEFILE_GENERATOR = XCODE
- else: \
- # For libs, etc we still want regular Makefiles
- MAKEFILE_GENERATOR = UNIX
-}
+ CONFIG -= have_target qt staticlib dll
+ SOURCES =
+ RESOURCES =
+ INSTALLS =
+
+ TARGET_XCODE_PROJECT_DIR = $${TARGET}.xcodeproj
+
+ system("cd $$system_quote($$OUT_PWD) && $${QMAKE_QMAKE} $$system_quote($$_PRO_FILE_) -spec macx-xcode")
-gui_app {
- # We have to do the link and dependency resolution for the platform plugin
- # manually, since QTPLUGIN and the prl lookup logic does not support
- # the -force_load link style. The -force_load option ensures that all
- # symbols from the static library are included, not just the ones the
- # linker have seen a use for so far. We need this because we load the platform
- # plugin from the platform plugin itself, using Q_IMPORT_PLUGIN.
- lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/libqios$$qtPlatformTargetSuffix()
- LIBS += "-force_load $${lib_path_and_base}.$${QMAKE_EXTENSION_STATICLIB}"
- LIBS += $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS)
+ # We use xcodebuild to do the actual build, but filter out the verbose
+ # output that shows all environment variables for each build step.
+ xcodebuild_build.commands = "@xcodebuild build | grep -v setenv"
+ QMAKE_EXTRA_TARGETS += xcodebuild_build
+ all.depends = xcodebuild_build
+ QMAKE_EXTRA_TARGETS += all
- # Which means we don't want the auto-generated import for the platform plugin
- CONFIG -= import_qpa_plugin
+ # We do the same for the clean action
+ xcodebuild_clean.commands = "@xcodebuild clean"
+ QMAKE_EXTRA_TARGETS += xcodebuild_clean
+ clean.depends = xcodebuild_clean
+ QMAKE_EXTRA_TARGETS += clean
- !no_main_wrapper {
- # We link the iosmain library manually as well, since it's not really a plugin
- lib_name = qiosmain
- lib_path_and_base = $$[QT_INSTALL_PLUGINS/get]/platforms/lib$${lib_name}$$qtPlatformTargetSuffix()
- LIBS += -L$$[QT_INSTALL_PLUGINS/get]/platforms -l$${lib_name}$$qtPlatformTargetSuffix()
- LIBS += $$fromfile($${lib_path_and_base}.prl, QMAKE_PRL_LIBS)
- DEFINES += main=qt_main
+ # And distclean
+ xcodebuild_distclean.commands = "$(DEL_FILE) -R $$TARGET_XCODE_PROJECT_DIR"
+ QMAKE_EXTRA_TARGETS += xcodebuild_distclean
+ distclean.depends = xcodebuild_distclean
+ QMAKE_EXTRA_TARGETS += distclean
}
}
-contains(MAKEFILE_GENERATOR, XCODE) {
+macx-xcode {
ios_device_family.name = TARGETED_DEVICE_FAMILY
ios_device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
QMAKE_MAC_XCODE_SETTINGS += ios_device_family
@@ -46,24 +50,27 @@ isEmpty(QT_ARCH) {
# but we fail to pick up the architecture since we're not passing -arch
# yet. Xcode does not seem to have a way to run the shared toolchain
# in a way that will automatically do this (for example xcrun -sdk).
- contains(QMAKE_MAC_SDK, iphoneos.*): QT_ARCH = armv7
+ contains(QMAKE_MAC_SDK, iphoneos.*): QT_ARCH = arm
else: QT_ARCH = i386 # Simulator
-} else {
- # Fix up the QT_ARCH to be more specific
- equals(QT_ARCH, arm) {
- # Samsung S5PC100, Apple A4, A5, A5X
- QT_ARCH = armv7
-
- # FIXME: How do we support armv7s when Qt can't do universal builds?
- }
}
-!equals(MAKEFILE_GENERATOR, XCODE) {
- arch_flag = -arch $$QT_ARCH
- QMAKE_CFLAGS += $$arch_flag
- QMAKE_CXXFLAGS += $$arch_flag
- QMAKE_OBJECTIVE_CFLAGS += $$arch_flag
- QMAKE_LFLAGS += $$arch_flag
+# Be more specific about which architecture we're targeting
+equals(QT_ARCH, arm): \
+ actual_archs = armv7
+else: \
+ actual_archs = $$QT_ARCH
+
+macx-xcode {
+ QMAKE_XCODE_ARCHS = $$actual_archs
+} else {
+ for(arch, actual_archs): \
+ arch_flags += -arch $$arch
+
+ QMAKE_CFLAGS += $$arch_flags
+ QMAKE_CXXFLAGS += $$arch_flags
+ QMAKE_OBJECTIVE_CFLAGS += $$arch_flags
+ QMAKE_LFLAGS += $$arch_flags
}
+unset(actual_archs)
load(default_post)
diff --git a/mkspecs/features/ios/default_pre.prf b/mkspecs/features/ios/default_pre.prf
index 7cfbc03eb5..5db8d98d6c 100644
--- a/mkspecs/features/ios/default_pre.prf
+++ b/mkspecs/features/ios/default_pre.prf
@@ -1,5 +1,3 @@
-# Unset makefile generator, so we can auto-detect value in default_post
-!macx-xcode: unset(MAKEFILE_GENERATOR)
load(default_pre)
diff --git a/mkspecs/features/ios/qt.prf b/mkspecs/features/ios/qt.prf
new file mode 100644
index 0000000000..80d4907acd
--- /dev/null
+++ b/mkspecs/features/ios/qt.prf
@@ -0,0 +1,24 @@
+
+equals(TEMPLATE, app):contains(QT, gui(-private)?) {
+ LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms
+
+ lib_name = qios
+ 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)
+
+ # By marking qt_registerPlatformPlugin as undefined, we ensure that
+ # the plugin.o translation unit is considered for inclusion in
+ # the final binary, which in turn ensures that the plugin's
+ # static initializer is included and run.
+ QMAKE_LFLAGS += -u _qt_registerPlatformPlugin
+
+ # We do link and dependency resolution for the platform plugin
+ # manually, since we know we always need the plugin, so we don't
+ # need to generate an import for it.
+ CONFIG -= import_qpa_plugin
+
+ # FIXME: Solve using 'ld -r -alias -unexported_symbol' instead
+ !no_main_wrapper: DEFINES += main=qt_user_main
+}
+
+load(qt)
diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf
index d8ceb536a7..7815b5ef38 100644
--- a/mkspecs/features/java.prf
+++ b/mkspecs/features/java.prf
@@ -12,10 +12,11 @@ android {
isEmpty(BUILD_TOOLS_REVISION): BUILD_TOOLS_REVISION = 17.0.0
}
- !exists($$SDK_ROOT/platforms/$$API_VERSION/android.jar) {
- error("The Path $$SDK_ROOT/platforms/$$API_VERSION/android.jar does not exist. Make sure the ANDROID_SDK_ROOT and ANDROID_API_VERSION environment variables are correctly set.")
+ ANDROID_JAR_FILE = $$SDK_ROOT/platforms/$$API_VERSION/android.jar
+ !exists($$ANDROID_JAR_FILE) {
+ error("The Path $$ANDROID_JAR_FILE does not exist. Make sure the ANDROID_SDK_ROOT and ANDROID_API_VERSION environment variables are correctly set.")
}
- JAVACLASSPATH += $$SDK_ROOT/platforms/$$API_VERSION/android.jar
+ JAVACLASSPATH += $$ANDROID_JAR_FILE
# FIXME: This is a hack to work around some hardcoded values in the android.prf. The
# android.prf should be fixed and this should be removed.
@@ -37,7 +38,7 @@ CONFIG += plugin no_plugin_name_prefix
javac.input = JAVASOURCES
javac.output = $$CLASS_DIR
javac.CONFIG += combine
-javac.commands = javac -source 6 -target 6 -cp $$shell_quote($$shell_path($$join(JAVACLASSPATH, $$QMAKE_DIRLIST_SEP))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN}
+javac.commands = javac -source 6 -target 6 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$shell_path($$join(JAVACLASSPATH, $$QMAKE_DIRLIST_SEP))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN}
# Force rebuild every time, because we don't know the paths of the destination files
# as they depend on the code.
javac.depends = FORCE
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 10b7736749..3c5d4b9dd6 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -24,31 +24,34 @@ warnings_are_errors:warning_clean {
# This setting is compiler-dependent anyway because it depends on the version of the
# compiler.
clang {
- # Apple clang 4.0+ or clang 3.1+
- greaterThan(QT_CLANG_MAJOR_VERSION, 3) | \
- if(equals(QT_CLANG_MAJOR_VERSION, 3):greaterThan(QT_CLANG_MINOR_VERSION, 1)) | \
- greaterThan(QT_APPLE_CLANG_MAJOR_VERSION, 3) {
- QMAKE_CXXFLAGS += -Werror -Wno-error=\\$${LITERAL_HASH}warnings $$WERROR
+ # Apple clang 4.0-4.2
+ # Regular clang is not tested
+ ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
+ contains(ver, "4\\.[012]") {
+ QMAKE_CXXFLAGS += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated $$WERROR
}
- } else:intel_icc {
- # Intel CC 13.0+ (a.k.a. Intel Composer XE 2013)
- greaterThan(QT_ICC_MAJOR_VERSION, 12) {
+ } else:intel_icc:linux {
+ # Intel CC 13.0 - 14.0, on Linux only
+ ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION}
+ linux:contains(ver, "(13\\.|14\\.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
# 1881: argument must be a constant null pointer value
# (NULL in C++ is usually a literal 0)
- QMAKE_CXXFLAGS += -Werror -ww177,1224,1881 $$WERROR
+ QMAKE_CXXFLAGS += -Werror -ww177,1224,1478,1881 $$WERROR
}
- } else:gcc {
- # GCC 4.6+
- # note: there was no GCC 3.6 and this assumes no one is crazy enough to compile Qt with GCC 2.7
- greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 5) {
- QMAKE_CXXFLAGS += -Werror -Wno-error=cpp $$WERROR
+ } else:gcc:!clang:!intel_icc {
+ # GCC 4.6-4.8
+ ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
+ contains(ver, "4\\.[678]") {
+ QMAKE_CXXFLAGS += -Werror -Wno-error=cpp -Wno-error=deprecated $$WERROR
# GCC prints this bogus warning, after it has inlined a lot of code
# error: assuming signed overflow does not occur when assuming that (X + c) < X is always false
QMAKE_CXXFLAGS += -Wno-error=strict-overflow
}
}
+ unset(ver)
}
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 85e2db25bc..be3cd5273c 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -34,7 +34,7 @@ qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
qtvertag.name = QT_VERSION_TAG
qtvertag.value = $$replace(qtver.value, \.,)
qtdocs.name = QT_INSTALL_DOCS
-qtdocs.value = $$[QT_INSTALL_DOCS/get]
+qtdocs.value = $$[QT_INSTALL_DOCS/src]
qtAddToolEnv(QDOC, qtver qtmver qtvertag qtdocs)
doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs {
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 07821fd09b..c8d151ce4d 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -71,11 +71,6 @@ defineTest(qtAddModule) {
MODULE_LIBS_ADD = $$MODULE_LIBS
MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
- INCLUDEPATH *= $$MODULE_INCLUDES
- auto_use_privates|isEqual(2, UsePrivate) { # Tests function parameter 2 ($$2) being equal to 'UsePrivate'
- INCLUDEPATH += $$eval(QT.$${1}.private_includes)
- }
-
unset(LINKAGE)
mac:contains(MODULE_CONFIG, lib_bundle) {
FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers
@@ -88,6 +83,10 @@ defineTest(qtAddModule) {
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME
QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX}
+ } else {
+ INCLUDEPATH *= $$MODULE_INCLUDES
+ auto_use_privates|isEqual(2, UsePrivate): \
+ INCLUDEPATH += $$eval(QT.$${1}.private_includes)
}
# Re-insert the major version in the library name (cf qtLibraryTarget above)
diff --git a/mkspecs/features/simd.prf b/mkspecs/features/simd.prf
index 14da926dc3..e0cd5a3a58 100644
--- a/mkspecs/features/simd.prf
+++ b/mkspecs/features/simd.prf
@@ -12,6 +12,9 @@
# Get the SIMD flags
load(qt_build_config)
+# Set QT_CPU_FEATURES for convenience
+QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
+
#
# Set up compilers for SIMD (SSE/AVX, NEON etc)
#
diff --git a/mkspecs/features/spec_post.prf b/mkspecs/features/spec_post.prf
index c9e9f8b2f6..ad03c9c428 100644
--- a/mkspecs/features/spec_post.prf
+++ b/mkspecs/features/spec_post.prf
@@ -9,7 +9,7 @@ isEmpty(QMAKE_PLATFORM) {
isEmpty(TARGET_PLATFORM) {
equals(MAKEFILE_GENERATOR, UNIX) {
equals(QMAKE_HOST.os, Darwin): \
- TARGET_PLATFORM = macx
+ TARGET_PLATFORM = macx # backwards compatibility; cannot change
else: \
TARGET_PLATFORM = unix
} else:if(equals(MAKEFILE_GENERATOR, MSVC.NET) \
@@ -28,12 +28,18 @@ isEmpty(QMAKE_PLATFORM) {
equals(TARGET_PLATFORM, unix): \
QMAKE_PLATFORM = unix
else:equals(TARGET_PLATFORM, macx): \
- QMAKE_PLATFORM = mac macx unix
+ QMAKE_PLATFORM = osx macx mac darwin unix
else:equals(TARGET_PLATFORM, win32): \
QMAKE_PLATFORM = win32
else: \
error("Qmake spec sets an invalid TARGET_PLATFORM.")
}
+
+contains(QMAKE_PLATFORM, macx):!contains(QMAKE_PLATFORM, osx) {
+ warning("qmake spec specifies platform macx, but not osx.")
+ QMAKE_PLATFORM = osx $$QMAKE_PLATFORM
+}
+
CONFIG += $$QMAKE_PLATFORM
isEmpty(QMAKE_COMPILER) {