2018-09-07 20:20:42 +00:00
|
|
|
static:no-static-ltcg {
|
|
|
|
# Static library but no-static-ltcg enabled: skip LTCG
|
|
|
|
} else: CONFIG(release, debug|release) {
|
2014-06-26 21:56:06 +00:00
|
|
|
# We need fat object files when creating static libraries on some platforms
|
|
|
|
# so the linker will know to load a particular object from the library
|
2014-11-15 03:27:46 +00:00
|
|
|
# in the first place. On others, we have special ar and nm to create the symbol
|
2019-03-18 09:17:22 +00:00
|
|
|
# tables so the linker will know better. For other compilers, we disable LTCG
|
2014-06-26 21:56:06 +00:00
|
|
|
# for static libraries.
|
|
|
|
msvc {
|
|
|
|
# Nothing to do
|
2014-11-15 03:27:46 +00:00
|
|
|
} else {
|
|
|
|
!isEmpty(QMAKE_AR_LTCG): QMAKE_AR = $$QMAKE_AR_LTCG
|
|
|
|
!isEmpty(QMAKE_NM_LTCG): QMAKE_NM = $$QMAKE_NM_LTCG
|
|
|
|
|
|
|
|
equals(QMAKE_RANLIB_LTCG, true): QMAKE_RANLIB =
|
|
|
|
else: !isEmpty(QMAKE_RANLIB_LTCG): QMAKE_RANLIB = $$QMAKE_RANLIB_LTCG
|
|
|
|
|
|
|
|
static:isEmpty(QMAKE_AR_LTCG):isEmpty(QMAKE_RANLIB_LTCG) {
|
|
|
|
# We don't know how to create symbol tables for static libs with this
|
|
|
|
# compiler, so disable LTCG
|
2014-06-26 21:56:06 +00:00
|
|
|
QMAKE_CFLAGS_LTCG =
|
|
|
|
QMAKE_CXXFLAGS_LTCG =
|
|
|
|
QMAKE_LFLAGS_LTCG =
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-07 20:20:42 +00:00
|
|
|
fat-lto|if(static:fat-static-lto) {
|
2014-11-15 03:27:46 +00:00
|
|
|
QMAKE_CFLAGS_LTCG += $$QMAKE_CFLAGS_LTCG_FATOBJECTS
|
|
|
|
QMAKE_CXXFLAGS_LTCG += $$QMAKE_CXXFLAGS_LTCG_FATOBJECTS
|
|
|
|
}
|
|
|
|
|
2014-11-23 05:00:34 +00:00
|
|
|
load(link_ltcg)
|
2019-06-14 04:39:19 +00:00
|
|
|
QMAKE_CFLAGS -= $$QMAKE_CFLAGS_LTCG
|
|
|
|
QMAKE_CFLAGS += $$QMAKE_CFLAGS_LTCG
|
|
|
|
QMAKE_CXXFLAGS -= $$QMAKE_CXXFLAGS_LTCG
|
|
|
|
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_LTCG
|
|
|
|
QMAKE_LFLAGS -= $$QMAKE_LFLAGS_LTCG
|
|
|
|
QMAKE_LFLAGS += $$QMAKE_LFLAGS_LTCG
|
2014-06-26 21:56:06 +00:00
|
|
|
}
|