From 53280989fb66cbaaa07c25fc0f23ec07dd00d734 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Date: Thu, 31 Oct 2013 20:27:54 +0100
Subject: [PATCH] use the new "stash" instead of the (anything but) "regular"
 cache

as this new cache category comes without side effects, we can
unconditionally create a cache whereever we are. this allows us to be
performant without explicit user action.

Task-number: QTBUG-31340
Change-Id: I6b88b20b61e8351aa8cbf94ad3eec65adac6e1d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
---
 mkspecs/features/mac/default_post.prf | 9 ++-------
 mkspecs/features/mac/sdk.prf          | 6 +++---
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 5d0fdb092f8..c3addf93195 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -19,13 +19,8 @@ qt:!isEmpty(QT_CONFIG) {
     contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11
 }
 
-isEmpty(_QMAKE_CACHE_) {
-    warning("No .qmake.cache is present. This significantly slows down qmake with this makespec.")
-    warning("Call 'cache()' in the top-level project file to rectify this problem.")
-} else {
-    cache(QMAKE_XCODE_DEVELOPER_PATH)
-    cache(QMAKE_XCODE_VERSION)
-}
+cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
+cache(QMAKE_XCODE_VERSION, stash)
 
 QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
 
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index 788fa5b3622..5b5186a14b9 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -8,7 +8,7 @@ contains(QMAKE_MAC_SDK, .*/.*): \
 isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
     QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
     isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
-    !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set, QMAKE_MAC_SDK_PATH)
+    cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH)
 } else {
     QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)
 }
@@ -41,7 +41,7 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
     isEmpty(sysrooted): next()
 
     $$tool = $$sysrooted $$member(value, 1, -1)
-    !isEmpty(_QMAKE_CACHE_): cache($$tool_variable, set, $$tool)
+    cache($$tool_variable, set stash, $$tool)
 }
 
 isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
@@ -52,7 +52,7 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
         "sed 's/.*Value: \\(.*\\)/\\1/'")
 
     isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
-    !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set, QMAKE_MAC_PLATFORM_NAME)
+    cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set stash, QMAKE_MAC_PLATFORM_NAME)
 } else {
     QMAKE_MAC_PLATFORM_NAME = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name)
 }
-- 
GitLab