[CMake] CMake 2.8.6 --> 2.8.8 New TryCompile Fails on GCC-GNAT Ada Linking

Matthew Schuchard matthew.schuchard at gtri.gatech.edu
Fri Jul 6 07:46:23 EDT 2012


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?
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.

On 07/05/2012 03:57 PM, Brad King wrote:
> On 7/2/2012 12:25 PM, Matthew Schuchard wrote:
>> The executable name does in fact have to match the name of the source file.
>> I could get into details, but the short summary is that gcc-gnat is a
>> very headache-inducing compiler with poorly conceived input/output file
>> behavior and arguments.
> The change in question is here:
>
>   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4fbdce2b
>
> It was done to try to work around problems on Windows tools and
> filesystems.  You can try hacking the change further to test a
> platform variable so it can be disabled for Ada tools.  If you
> get it working we can put that change upstream.
>
> -Brad



More information about the CMake mailing list