From: Alp Toker <alp@nuanti.com>
Date: Tue, 15 Jul 2014 22:11:54 +0000 (+0000)
Subject: CMake: avoid a reconfigure loop from r213091
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=427c5cb4f9887097578704423d740bbcf366f539;p=llvm

CMake: avoid a reconfigure loop from r213091

Removing the native CMakeCache.txt causes the target to get re-run needlessly
on some systems. We'll want another solution for that part of the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213099 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index e46b4ae240b..845c986ae2e 100644
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -86,8 +86,7 @@ if(CMAKE_CROSSCOMPILING)
   endforeach()
 
   add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}/CMakeCache.txt
-    # Remove the old cache to avoid persisting previous flags.
-    COMMAND ${CMAKE_COMMAND} -E remove ${CX_NATIVE_TG_DIR}/CMakeCache.txt
+    # TODO: Clear the old CMakeCache.txt somehow without breaking restat.
     COMMAND ${CMAKE_COMMAND} -UMAKE_TOOLCHAIN_FILE -DCMAKE_BUILD_TYPE=Release
                              -DLLVM_BUILD_POLLY=OFF ${CX_CMAKE_ARGUMENTS}
                              -G "${CMAKE_GENERATOR}" ${CMAKE_SOURCE_DIR}