On 07/06/2012 07:46 AM, Matthew Schuchard wrote:
> I thought the change had been to preserve prior TryCompiles for 
> debugging purposes.
> Would it be too cynical to propose some OS #ifdefs above the code?
> Although you mention file systems, so this an NTFS issue also?

We don't know what causes it.  Some virus scanners will hold a handle
on executable files while scanning them immediately after creation so
there is a race for deletion before the next try-compile runs.  There
have been other more mysterious problems too, all having something to
do with rapid creation and deletion of .exe files.

> Of course, at the end of the day this is what breaks GNAT TryCompile:
> 
> - targetName = "cmTryCompileExec";
> 
> But not removing that line of code would seemingly break everything else.
> 
> So the path of least resistance cynical code change proposal:
> 
> #ifdef __linux__
> targetNameBuf = "cmTryCompileExec";
> #else
> sprintf(targetNameBuf, "cmTryCompileExec%u",
>             cmSystemTools::RandomSeed());
> #endif
> 
> With a nice comment like "so this annoying coding language Ada and its 
> terribly conceived compiler GNAT can be supported on Linux" or some such.

I'd rather it be something like

 if(this->Makefile->IsOn("CMAKE_"+lang+"_TRY_COMPILE_NO_RANDOM"))

so your platform files can control it.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to