2012-03-16 15:00:33 +00:00
|
|
|
#
|
|
|
|
# compiler settings for iOS clang compilers
|
|
|
|
#
|
|
|
|
|
|
|
|
# iOS build flags
|
2012-11-01 12:18:15 +00:00
|
|
|
QMAKE_IOS_CFLAGS += -fvisibility=hidden -fpascal-strings -fmessage-length=0
|
2012-03-16 15:00:33 +00:00
|
|
|
QMAKE_IOS_CFLAGS += -Wno-trigraphs -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -Wno-sign-conversion
|
2012-11-01 12:18:15 +00:00
|
|
|
QMAKE_IOS_CXXFLAGS += -fvisibility-inlines-hidden
|
2012-03-16 15:00:33 +00:00
|
|
|
|
2012-11-20 14:25:34 +00:00
|
|
|
# Based on the following information, http://clang.llvm.org/doxygen/ObjCRuntime_8h_source.html,
|
|
|
|
# we can conclude that it's safe to always pass the following flags
|
2013-03-19 01:57:31 +00:00
|
|
|
QMAKE_IOS_OBJ_CFLAGS += -fobjc-nonfragile-abi -fobjc-legacy-dispatch
|
2012-11-20 14:25:34 +00:00
|
|
|
|
|
|
|
# But these only apply to non-ARM targets
|
|
|
|
!contains(QT_ARCH, arm): QMAKE_IOS_CFLAGS += -fexceptions -fasm-blocks
|
|
|
|
|
2012-11-01 11:31:36 +00:00
|
|
|
# Clang 3.1 (and above) flags
|
2013-03-19 01:57:31 +00:00
|
|
|
QMAKE_IOS_CFLAGS += -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wno-unused-function -Wno-unused-label -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wpointer-sign -Wno-newline-eof -Wdeprecated-declarations -Winvalid-offsetof -Wno-conversion
|
|
|
|
QMAKE_IOS_CXXFLAGS += -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors
|
|
|
|
QMAKE_IOS_OBJ_CFLAGS += -Wno-deprecated-implementations -Wprotocol -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector
|
2012-03-16 15:00:33 +00:00
|
|
|
|
|
|
|
# Set build flags
|
|
|
|
QMAKE_CFLAGS += $$QMAKE_IOS_CFLAGS
|
|
|
|
QMAKE_CXXFLAGS += $$QMAKE_IOS_CFLAGS $$QMAKE_IOS_CXXFLAGS
|
Distinguish between Objective-C and Objective-C++ sources
Instead of lumping both Objective-C (.m) and Objective-C++ (.mm) sources
into the same pile, passing them on to the same compiler as for C++ (CXX),
with the C++ flags (CXXFLAGS), we follow Apple's lead and treat them as
variants of the C and C++ languages separately, so that Objective-C
sources are built with CC and with CFLAGS, and Objective-C++ sources
with CXX, and CXXFLAGS.
This lets us remove a lot of duplicated flags and definitions from the
QMAKE_OBJECTIVE_CFLAGS variable, which in 99% of the cases just matched
the C++ equivalent. The remaining Objective-C/C++ flags are added to
CFLAGS/CXXFLAGS, as the compiler will just ignore them when running in
C/C++ mode. This matches Xcode, which also doesn't have a separate build
setting for Objective-C/C++ flags.
The Makefile qmake generator has been rewritten to support Objective-C/C++
fully, by not assuming that we're just iterating over the C and C++
extensions when dealing with compilation rules, precompiled headers, etc.
There's some duplicated logic in this code, as inherent by qmake's already
duplicated code paths, but this can be cleaned up when C++11 support is
mandatory and we can use lambda functions.
Task-number: QTBUG-36575
Change-Id: I4f06576d5f49e939333a2e03d965da54119e5e31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-10-02 11:54:33 +00:00
|
|
|
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_OBJ_CFLAGS
|
2012-03-16 15:00:33 +00:00
|
|
|
|
2013-03-19 01:57:31 +00:00
|
|
|
QMAKE_IOS_CFLAGS =
|
|
|
|
QMAKE_IOS_CXXFLAGS =
|
|
|
|
QMAKE_IOS_OBJ_CFLAGS =
|