From 9ff1310af51814e521572fa3de4e086907633a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 2 Oct 2015 13:54:33 +0200 Subject: Distinguish between Objective-C and Objective-C++ sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/testlib/testlib.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/testlib/testlib.pro') diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 0070cdb271..ff4379f85d 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -92,7 +92,7 @@ mac { # don't know yet if the target that links to testlib will build under Xcode or not. # The corresponding flags for the target lives in xctest.prf, where we do know. QMAKE_LFLAGS += -F$${platform_dev_frameworks_path} -weak_framework XCTest - QMAKE_OBJECTIVE_CFLAGS += -F$${platform_dev_frameworks_path} + QMAKE_CXXFLAGS += -F$${platform_dev_frameworks_path} MODULE_CONFIG += xctest } } -- cgit v1.2.3