[cmake-developers] CheckSymbolExists is unreliable

Brad King brad.king at kitware.com
Fri Jan 6 09:56:53 EST 2012


On 1/5/2012 8:25 AM, Brad King wrote:
>> So I will go and fix some small typos I've found in the existing tests,
>> repush and merge to next, so we see if Check*SymbolExists will work.
>
> Sounds good.

The new CheckSymbolExists test works everywhere!

   http://www.cdash.org/CDash/testSummary.php?project=1&name=CheckSymbolExists&date=2012-01-06

However the CheckCXXSymbolExist test fails:

   http://www.cdash.org/CDash/testSummary.php?project=1&name=CheckCXXSymbolExists&date=2012-01-06

I think it is because of a leftover --debug-trycompile option in the test line.
That option works only when a single try-compile is invoked.

Also, the tests are currently added differently from the other tests and are
not handled by our "make test_clean" target.  Furthermore the tests only get
cleaned up by the file(REMOVE...) code in their CMakeLists.txt files when the
main CMake build tree re-configures.

Please change the way the tests are added to be consistent with the
Module.CheckTypeSize test.  IOW most of what is currently CMakeLists.txt.in
can just go in CMakeLists.txt and the directory should not have its own
add_test call.  If you want to ensure that the try-compiles always re-run
then add a line like

   unset(CSE_RESULT_... CACHE)

just before each call to a check macro.

Thanks,
-Brad



More information about the cmake-developers mailing list