2012-12-11 21:22:23 +00:00
|
|
|
# This file is loaded by qmake right before loading the qmakespec.
|
|
|
|
# At this point, the built-in variables have been set up and the project's
|
|
|
|
# .qmake.super was read (if present).
|
|
|
|
|
2012-04-20 18:27:15 +00:00
|
|
|
QMAKE_DIR_SEP = $$DIR_SEPARATOR
|
|
|
|
QMAKE_DIRLIST_SEP = $$DIRLIST_SEPARATOR
|
|
|
|
|
|
|
|
QMAKE_EXT_C = .c
|
|
|
|
QMAKE_EXT_CPP = .cpp .cc .cxx
|
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_EXT_OBJC = .m
|
|
|
|
QMAKE_EXT_OBJCXX = .mm
|
2012-04-20 18:27:15 +00:00
|
|
|
QMAKE_EXT_CPP_MOC = .moc
|
|
|
|
QMAKE_EXT_H = .h .hpp .hh .hxx
|
|
|
|
QMAKE_EXT_H_MOC = .cpp
|
|
|
|
QMAKE_EXT_JS = .js
|
|
|
|
QMAKE_EXT_LEX = .l
|
|
|
|
QMAKE_EXT_LIBTOOL = .la
|
|
|
|
QMAKE_EXT_PKGCONFIG = .pc
|
|
|
|
QMAKE_EXT_PRL = .prl
|
|
|
|
QMAKE_EXT_UI = .ui
|
|
|
|
QMAKE_EXT_YACC = .y
|
|
|
|
|
|
|
|
QMAKE_CPP_MOD_MOC =
|
|
|
|
QMAKE_H_MOD_MOC = moc_
|
|
|
|
QMAKE_MOD_LEX = _lex
|
|
|
|
QMAKE_MOD_YACC = _yacc
|
|
|
|
|
2015-04-09 11:21:46 +00:00
|
|
|
defineTest(ensurePathEnv) {
|
|
|
|
isEmpty(QMAKE_PATH_ENV) {
|
|
|
|
QMAKE_PATH_ENV = $$(PATH)
|
|
|
|
QMAKE_PATH_ENV = $$split(QMAKE_PATH_ENV, $$QMAKE_DIRLIST_SEP)
|
|
|
|
export(QMAKE_PATH_ENV)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-20 18:27:15 +00:00
|
|
|
equals(QMAKE_HOST.os, Windows) {
|
|
|
|
QMAKE_EXT_OBJ = .obj
|
|
|
|
QMAKE_EXT_RES = .res
|
|
|
|
QMAKE_SH =
|
2015-04-09 11:21:46 +00:00
|
|
|
ensurePathEnv()
|
|
|
|
for(dir, QMAKE_PATH_ENV) {
|
2012-04-20 18:27:15 +00:00
|
|
|
exists($$dir/sh.exe) {
|
|
|
|
QMAKE_SH = $$dir/sh.exe
|
|
|
|
break()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
QMAKE_EXT_CPP += .C
|
|
|
|
QMAKE_EXT_H += .H
|
|
|
|
QMAKE_EXT_OBJ = .o
|
|
|
|
QMAKE_SH = sh
|
|
|
|
}
|
2012-09-03 13:12:07 +00:00
|
|
|
|
2012-09-03 13:38:31 +00:00
|
|
|
CONFIG = qt warn_on release link_prl
|
2012-09-03 13:12:07 +00:00
|
|
|
QT = core gui
|