2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
|
|
|
|
2012-10-23 20:15:43 +00:00
|
|
|
load(qt_build_paths)
|
2012-07-10 19:35:39 +00:00
|
|
|
|
2013-05-28 19:34:05 +00:00
|
|
|
!build_pass:git_build {
|
2014-09-15 15:30:42 +00:00
|
|
|
qtPrepareTool(QMAKE_SYNCQT, syncqt, , system)
|
2013-03-05 10:38:24 +00:00
|
|
|
minimal_syncqt {
|
|
|
|
QMAKE_SYNCQT += -minimal $$QMAKE_SYNCQT_OPTIONS
|
|
|
|
} else {
|
|
|
|
contains(QT_CONFIG, private_tests): \ # -developer-build
|
|
|
|
QMAKE_SYNCQT += -check-includes
|
2013-03-21 07:18:12 +00:00
|
|
|
QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION
|
2013-03-05 10:38:24 +00:00
|
|
|
}
|
|
|
|
QMAKE_SYNCQT += \
|
2014-11-27 13:12:40 +00:00
|
|
|
-outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
|
2012-09-18 16:19:29 +00:00
|
|
|
!silent: message($$QMAKE_SYNCQT)
|
|
|
|
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
|
2015-04-23 11:40:49 +00:00
|
|
|
|
|
|
|
include-distclean.commands = $$QMAKE_DEL_TREE $$shell_quote($$shell_path($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME))
|
|
|
|
QMAKE_EXTRA_TARGETS += include-distclean
|
|
|
|
DISTCLEAN_DEPS += include-distclean
|
2012-09-18 16:19:29 +00:00
|
|
|
}
|
|
|
|
|
2013-03-05 10:38:24 +00:00
|
|
|
minimal_syncqt: return()
|
|
|
|
|
2012-04-25 09:41:09 +00:00
|
|
|
#load up the headers info
|
2013-05-28 19:34:05 +00:00
|
|
|
git_build: \
|
|
|
|
INC_PATH = $$MODULE_BASE_OUTDIR
|
|
|
|
else: \
|
2013-06-08 09:58:54 +00:00
|
|
|
INC_PATH = $$MODULE_BASE_INDIR
|
2013-05-28 19:34:05 +00:00
|
|
|
include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true)
|
2012-04-25 09:41:09 +00:00
|
|
|
|
2014-02-03 21:22:14 +00:00
|
|
|
for (injection, SYNCQT.INJECTIONS) {
|
|
|
|
injects = $$split(injection, :)
|
|
|
|
fwd_hdr = $$member(injects, 1)
|
|
|
|
MAIN_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$fwd_hdr
|
|
|
|
MAIN_FWD_CONT = '$${LITERAL_HASH}include "$$member(injects, 0)"'
|
|
|
|
write_file($$MAIN_FWD, MAIN_FWD_CONT)|error("Aborting.")
|
2015-04-23 11:40:49 +00:00
|
|
|
!git_build: QMAKE_DISTCLEAN += $$MAIN_FWD
|
2014-02-03 21:22:14 +00:00
|
|
|
injects = $$member(injects, 2, -1)
|
|
|
|
for (inject, injects) {
|
|
|
|
CLASS_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$inject
|
|
|
|
CLASS_FWD_CONT = '$${LITERAL_HASH}include "$$fwd_hdr"'
|
|
|
|
write_file($$CLASS_FWD, CLASS_FWD_CONT)|error("Aborting.")
|
2015-04-23 11:40:49 +00:00
|
|
|
!git_build: QMAKE_DISTCLEAN += $$CLASS_FWD
|
2014-02-03 21:22:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-30 14:32:36 +00:00
|
|
|
autogen_warning = \
|
2013-06-08 09:58:54 +00:00
|
|
|
"/* This file was generated by qmake with the info from <root>/$$relative_path($$_PRO_FILE_, $$MODULE_BASE_INDIR). */"
|
2012-11-30 14:32:36 +00:00
|
|
|
|
2013-05-28 17:09:24 +00:00
|
|
|
# Create a module master depends header
|
|
|
|
MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends
|
|
|
|
!build_pass {
|
|
|
|
MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning
|
2014-06-15 05:55:05 +00:00
|
|
|
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}ifdef __cplusplus /* create empty PCH in C mode */"
|
2013-05-28 17:09:24 +00:00
|
|
|
for(dep, MODULE_DEPENDS) {
|
2014-10-13 12:47:13 +00:00
|
|
|
depname = $$eval(QT.$${dep}.master_header)
|
|
|
|
isEmpty(depname): \
|
|
|
|
depname = $$eval(QT.$${dep}.name)
|
2013-05-28 17:09:24 +00:00
|
|
|
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>"
|
|
|
|
}
|
2014-06-15 05:55:05 +00:00
|
|
|
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}endif"
|
2013-05-28 17:09:24 +00:00
|
|
|
write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.")
|
2015-04-23 11:40:49 +00:00
|
|
|
!git_build: QMAKE_DISTCLEAN += $$MODULE_MASTER_DEPS_HEADER
|
2013-05-28 17:09:24 +00:00
|
|
|
}
|
|
|
|
SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER
|
|
|
|
|
2014-06-25 15:09:08 +00:00
|
|
|
# Automatically enable precompiled headers for Qt modules,
|
|
|
|
# except for Gcc/Windows: Larger precompiled headers crash cc1plus.exe
|
|
|
|
# (e.g. with i686-4.8.2-release-posix-dwarf-rt_v3-rev3)
|
2015-04-16 18:56:25 +00:00
|
|
|
!if(gcc:equals(QMAKE_HOST.os, Windows)):!equals(TEMPLATE, aux) {
|
2014-06-25 15:09:08 +00:00
|
|
|
isEmpty(PRECOMPILED_HEADER): PRECOMPILED_HEADER = $$MODULE_MASTER_DEPS_HEADER
|
|
|
|
}
|
2014-03-01 07:15:37 +00:00
|
|
|
|
2012-04-25 09:41:09 +00:00
|
|
|
CONFIG += qt_install_headers
|
2012-12-22 21:12:02 +00:00
|
|
|
|
|
|
|
headersclean:!internal_module {
|
|
|
|
# Make sure that the header compiles with our strict options
|
|
|
|
hcleanDEFS = -DQT_NO_CAST_TO_ASCII=1 \
|
|
|
|
-DQT_NO_CAST_FROM_ASCII=1 \
|
|
|
|
-DQT_STRICT_ITERATORS \
|
|
|
|
-DQT_NO_URL_CAST_FROM_STRING=1 \
|
|
|
|
-DQT_NO_CAST_FROM_BYTEARRAY=1 \
|
|
|
|
-DQT_NO_KEYWORDS=1 \
|
|
|
|
-DQT_USE_FAST_CONCATENATION \
|
|
|
|
-DQT_USE_FAST_OPERATOR_PLUS \
|
|
|
|
-Dsignals=int \
|
|
|
|
-Dslots=int \
|
|
|
|
-Demit=public: \
|
|
|
|
-Dforeach=public: \
|
|
|
|
-Dforever=public:
|
|
|
|
|
|
|
|
gcc {
|
|
|
|
# Turn on some extra warnings not found in -Wall -Wextra.
|
|
|
|
# Common to GCC, Clang and ICC (and other compilers that masquerade as GCC):
|
|
|
|
hcleanFLAGS = -Wall -Wextra -Werror \
|
|
|
|
-Woverloaded-virtual -Wshadow -Wundef \
|
|
|
|
-Wnon-virtual-dtor -Wpointer-arith -Wformat-security \
|
|
|
|
-Wno-long-long -Wno-variadic-macros -pedantic-errors
|
|
|
|
|
|
|
|
intel_icc {
|
|
|
|
# these warnings are disabled because explicit constructors with zero or
|
|
|
|
# multiple arguments are permitted in C++11:
|
|
|
|
# 2304: non-explicit constructor with single argument may cause implicit type conversion
|
|
|
|
# 2305: declaration of 'explicit' constructor without a single argument is redundant
|
|
|
|
hcleanFLAGS += -wd2304,2305
|
|
|
|
greaterThan(QT_ICC_MAJOR_VERSION, 13) {
|
|
|
|
# ICC 14+ has a bug with -Wshadow, emitting it for cases where there's no shadowing
|
|
|
|
# (issue ID 0000698329, task DPD200245740)
|
|
|
|
hcleanFLAGS -= -Wshadow
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
hcleanFLAGS += -Wchar-subscripts
|
|
|
|
|
|
|
|
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
|
|
|
|
hcleanFLAGS += -Wcast-align
|
|
|
|
}
|
|
|
|
|
|
|
|
# Use strict mode C++11 or C++98, with no GNU extensions (see -pedantic-errors above).
|
|
|
|
# The module might set CONFIG += c++11, but it might also change QMAKE_CXXFLAGS_CXX11
|
|
|
|
# or the module (or the mkspec) can set the C++11 flag on QMAKE_CXXFLAGS
|
|
|
|
# (or QMAKE_CXXFLAGS_{RELEASE,DEBUG} but that's unlikely).
|
|
|
|
c++11:contains(QMAKE_CXXFLAGS_CXX11, -std=gnu++11) {
|
|
|
|
hcleanFLAGS += -std=c++11
|
|
|
|
} else: contains(QMAKE_CXXFLAGS, -std=gnu++11) {
|
|
|
|
hcleanFLAGS += -std=c++11
|
|
|
|
} else: c++11:contains(QMAKE_CXXFLAGS_CXX11, -std=gnu++0x) {
|
|
|
|
hcleanFLAGS += -std=c++0x
|
|
|
|
} else: contains(QMAKE_CXXFLAGS, -std=gnu++0x) {
|
|
|
|
hcleanFLAGS += -std=c++0x
|
|
|
|
} else: !c++11:!contains(QMAKE_CXXFLAGS, -std=c++0x):!contains(QMAKE_CXXFLAGS, -std=c++11) {
|
|
|
|
hcleanFLAGS += -std=c++98
|
|
|
|
}
|
|
|
|
|
|
|
|
hcleanCOMMAND = $$QMAKE_CXX -c $(CXXFLAGS) $$hcleanFLAGS $(INCPATH) $$hcleanDEFS -xc++ ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
|
|
|
} else: win32-msvc2013 {
|
|
|
|
# 4180: qualifier applied to function type has no meaning; ignored
|
|
|
|
# 4458: declaration of 'identifier' hides class member
|
|
|
|
# -Za enables strict standards behavior, but we can't add it because
|
|
|
|
# <windows.h> and <GL.h> violate the standards.
|
|
|
|
hcleanFLAGS = -WX -W3 -wd4180 -wd4458
|
|
|
|
hcleanCOMMAND = $$QMAKE_CXX -c $(CXXFLAGS) $$hcleanFLAGS $(INCPATH) $$hcleanDEFS -FI${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT} \
|
|
|
|
$$[QT_INSTALL_DATA/src]/mkspecs/features/data/dummy.cpp
|
|
|
|
}
|
|
|
|
|
|
|
|
!isEmpty(hcleanCOMMAND):if(!contains(QT_CONFIG, debug_and_release)|CONFIG(release, debug|release)) {
|
|
|
|
header_check.dependency_type = TYPE_C
|
|
|
|
header_check.CONFIG += no_link
|
|
|
|
header_check.output = ${QMAKE_VAR_OBJECTS_DIR}header_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
|
|
|
header_check.input = SYNCQT.CLEAN_HEADER_FILES
|
|
|
|
header_check.variable_out = PRE_TARGETDEPS
|
|
|
|
header_check.name = headercheck ${QMAKE_FILE_IN}
|
|
|
|
header_check.commands = $$hcleanCOMMAND
|
|
|
|
silent:header_check.commands = @echo compiling[header] ${QMAKE_FILE_IN} && $$hcleanCOMMAND
|
|
|
|
QMAKE_EXTRA_COMPILERS += header_check
|
|
|
|
SYNCQT.CLEAN_HEADER_FILES -= $$HEADERSCLEAN_EXCLUDE
|
|
|
|
}
|
|
|
|
unset(hcleanCOMMAND)
|
|
|
|
unset(hcleanFLAGS)
|
|
|
|
unset(hcleanDEFS)
|
|
|
|
}
|