瀏覽代碼

BUG: The cmake_symlink_library command needs to remove existing files before creating links.

Brad King 22 年之前
父節點
當前提交
5bbc45d589
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Source/cmake.cxx

+ 8 - 0
Source/cmake.cxx

@@ -727,6 +727,10 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
       if(soName != realName)
         {
         std::string fname = cmSystemTools::GetFilenameName(realName);
+        if(cmSystemTools::FileExists(soName.c_str()))
+          {
+          cmSystemTools::RemoveFile(soName.c_str());
+          }
         if(!cmSystemTools::CreateSymlink(fname.c_str(), soName.c_str()))
           {
           result = 1;
@@ -735,6 +739,10 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
       if(name != soName)
         {
         std::string fname = cmSystemTools::GetFilenameName(soName);
+        if(cmSystemTools::FileExists(soName.c_str()))
+          {
+          cmSystemTools::RemoveFile(name.c_str());
+          }
         if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str()))
           {
           result = 1;