Преглед на файлове

Fix try_compile when file cannot be found

The try_compile() command's COPY_FILE option should not try to actually
copy the file if it cannot be found.  Some C runtime library's fopen
cannot handle an empty file name.
Brad King преди 16 години
родител
ревизия
172d503c61
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      Source/cmCoreTryCompile.cxx

+ 2 - 1
Source/cmCoreTryCompile.cxx

@@ -317,7 +317,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
 
     if ((res==0) && (copyFile.size()))
       {
-      if(!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(), 
+      if(this->OutputFile.empty() ||
+         !cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
                                         copyFile.c_str()))
         {
         cmOStringStream emsg;