[cmake-developers] CheckPrototypeDefinition concerns

Brad King brad.king at kitware.com
Thu Jan 5 08:28:46 EST 2012


On 1/5/2012 4:47 AM, Rolf Eike Beer wrote:
> Brad King wrote:
>> Can you handle Modules/CheckPrototypeDefinition.cmake too?  I think it
>> has the same problem.
>
> I have looked into this and I don't think it has. The subject of this
> thing is to provoke a compile error if the prototype doesn't match. And it
> even introduced the symbol _itself_, so it could even fail if you would
> provide the correct libraries the symbol is in using
> CMAKE_REQUIRED_LIBRARIES.
[snip]
> But it's usage of CMAKE_REQUIRED_LIBRARIES is completely wrong in my eyes
> as it could make the test actually fail when it should be successful. It
> shouldn't use any libraries at all IMHO. And even then it could go wrong
> when you reintroduce a symbol from the standard libraries, which could
> cause an error in the linker because of duplicate symbols.
>
> Or one would have to drop the newly introduced symbol in this file at all,
> using _only_ the symbol from the provided libraries. And then we would
> have the optimization problem, but if that is solved the whole thing can
> be made reliable at all.

I've CCed Andreas, the author of CheckPrototypeDefinition.  Andreas, please
see the above concerns Eike has raised about the module implementation.

Thanks,
-Brad



More information about the cmake-developers mailing list