ソースを参照

BUG: Need to remove the MAKEFLAGS when cmake starts. If cmake is run from inside make, we don't want the try-compiles to inherit the makeflags.

Brad King 22 年 前
コミット
02f7cfbcbe
1 ファイル変更10 行追加0 行削除
  1. 10 0
      Source/cmake.cxx

+ 10 - 0
Source/cmake.cxx

@@ -73,6 +73,16 @@ cmake::cmake()
     }
     }
 #endif
 #endif
 
 
+  // If MAKEFLAGS are given in the environment, remove the environment
+  // variable.  This will prevent try-compile from succeeding when it
+  // should fail (if "-i" is an option).  We cannot simply test
+  // whether "-i" is given and remove it because some make programs
+  // encode the MAKEFLAGS variable in a strange way.
+  if(getenv("MAKEFLAGS"))
+    {
+    putenv("MAKEFLAGS=");
+    }  
+  
   m_Local = false;
   m_Local = false;
   m_Verbose = false;
   m_Verbose = false;
   m_InTryCompile = false;
   m_InTryCompile = false;