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.
This commit is contained in:
parent
bc3cab3634
commit
172d503c61
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue