summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-07-21 10:21:02 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-01-11 03:41:35 +0100
commitd7795559a7b80d3ec0a1eb86d29deaca6074f4ed (patch)
tree8d46c2df0e78f5a6f4843b6ffb1921448cca44fb /mkspecs/features
parent62b752b3a2c9a69b5eb9a41b98293e83de347958 (diff)
Let qmake find the number of processors online
Instead of trying to load in ltcg.prf and cache the value. Change-Id: If485ff68fc6ff9d9cf7009cd72d5e702d0199c7f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/ltcg.prf10
1 files changed, 2 insertions, 8 deletions
diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf
index b0765a85c3..1a0980101f 100644
--- a/mkspecs/features/ltcg.prf
+++ b/mkspecs/features/ltcg.prf
@@ -15,16 +15,10 @@ CONFIG(release, debug|release) {
QMAKE_CFLAGS_LTCG += -fno-fat-lto-objects
QMAKE_CXXFLAGS_LTCG += -fno-fat-lto-objects
}
- linux {
- # Get the number of online processors, like _SC_NPROCESSORS_ONLN
- isEmpty(QMAKE_NPROCESSORS_ONLN) {
- QMAKE_NPROCESSORS_ONLN = $$system("grep -c '^processor' /proc/cpuinfo 2>/dev/null || echo 1")
- cache(QMAKE_NPROCESSORS_ONLN, set stash)
- }
-
+ greaterThan(QMAKE_HOST.cpu_count, 1) {
# Override LTO number of jobs
QMAKE_LFLAGS_LTCG -= -flto
- QMAKE_LFLAGS_LTCG += -flto=$$QMAKE_NPROCESSORS_ONLN
+ QMAKE_LFLAGS_LTCG += -flto=$$QMAKE_HOST.cpu_count
}
} else: static {
QMAKE_CFLAGS_LTCG =