瀏覽代碼

COMP: Handle windows with hack for now

Andy Cedilnik 20 年之前
父節點
當前提交
0addc75520
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      Source/cmSystemTools.cxx

+ 11 - 0
Source/cmSystemTools.cxx

@@ -1282,7 +1282,18 @@ bool cmSystemTools::PutEnv(const char* value)
 
 
 bool cmSystemTools::UnsetEnv(const char* value)
 bool cmSystemTools::UnsetEnv(const char* value)
 {
 {
+#ifdef _WIN32
+  std::string var = value;
+  std::string::size_type pos = var.find("=");
+  if ( pos == var.npos )
+    {
+    continue;
+    }
+  var = var.substr(0, pos+1);
+  return cmSystemTools::PutEnv(var.c_str());
+#else
   return unsetenv(value) == 0;
   return unsetenv(value) == 0;
+#endif
 }
 }
 
 
 std::vector<std::string> cmSystemTools::GetEnvironmentVariables()
 std::vector<std::string> cmSystemTools::GetEnvironmentVariables()