2014-11-23 05:00:34 +00:00
|
|
|
gcc {
|
2016-11-25 14:07:48 +00:00
|
|
|
# on Windows, MinGW's support for -flto=N is broken
|
2017-04-03 05:59:23 +00:00
|
|
|
intel_icc {
|
|
|
|
QMAKE_LFLAGS_LTCG ~= s/-ipo/-ipo=$$QMAKE_HOST.cpu_count/
|
|
|
|
} else: !clang:!equals(QMAKE_HOST.os, Windows):greaterThan(QMAKE_HOST.cpu_count, 1) {
|
2014-11-15 03:27:46 +00:00
|
|
|
# Override LTO number of jobs
|
|
|
|
QMAKE_LFLAGS_LTCG ~= s/^-flto$/-flto=$$QMAKE_HOST.cpu_count/
|
|
|
|
}
|
|
|
|
|
2014-11-23 05:00:34 +00:00
|
|
|
# When doing link-time code generation, we need to pass the compiler
|
|
|
|
# flags during linking the stage too. This file is processed after
|
|
|
|
# default_post.prf, so the QMAKE_CXXFLAGS already contains
|
|
|
|
# QMAKE_CXXFLAGS_DEBUG or _RELEASE.
|
|
|
|
use_c_linker {
|
|
|
|
# use_c_linker.prf is in effect, use the C flags
|
|
|
|
QMAKE_LFLAGS_LTCG += $$QMAKE_CFLAGS $$QMAKE_CFLAGS_LTCG
|
|
|
|
QMAKE_LFLAGS_APP += $$QMAKE_CFLAGS_APP
|
|
|
|
QMAKE_LFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
|
|
|
|
QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB
|
|
|
|
} else {
|
|
|
|
QMAKE_LFLAGS_LTCG = $$QMAKE_CXXFLAGS $$QMAKE_LFLAGS_LTCG
|
|
|
|
QMAKE_LFLAGS_APP += $$QMAKE_CXXFLAGS_APP
|
|
|
|
QMAKE_LFLAGS_SHLIB += $$QMAKE_CXXFLAGS_SHLIB
|
|
|
|
QMAKE_LFLAGS_PLUGIN += $$QMAKE_CFLAGS_SHLIB
|
|
|
|
}
|
|
|
|
}
|