[llvm-commits] [llvm] r74284 - in /llvm/trunk: cmake/config-ix.cmake include/llvm/Config/config.h.cmake - cmake bug?
Douglas Gregor
dgregor at apple.com
Mon Jun 29 09:28:03 PDT 2009
On Jun 26, 2009, at 10:50 AM, Xerxes RĂ„nby wrote:
> Hi Doug.
>
> Im having some issues with these two test when implemented using
> check_symbol_exists(), they both fail when they should not.
> cd llvm
> svn up
> cd ..
> mkdir llvm-build
> cd llvm-build
> cmake ../llvm
> ...
> -- Looking for pthread_create in pthread
> -- Looking for pthread_create in pthread - found
> ...
> -- Looking for pthread_mutex_lock
> -- Looking for pthread_mutex_lock - found
> -- Looking for pthread_rwlock_init
> -- Looking for pthread_rwlock_init - not found.
> -- Looking for pthread_getspecific
> -- Looking for pthread_getspecific - not found.
>
> if i change config-ix.cmake to use check_library_exists() for the
> tests then they both succeed on the same machine:
>
> -- Looking for pthread_create in pthread
> -- Looking for pthread_create in pthread - found
> -- Looking for pthread_getspecific in pthread
> -- Looking for pthread_getspecific in pthread - found
> -- Looking for pthread_rwlock_init in pthread
> -- Looking for pthread_rwlock_init in pthread - found
> ...
> -- Looking for pthread_mutex_lock
> -- Looking for pthread_mutex_lock - found
>
> Im a bit puzzled why check_symbol_exists() dont seem to work for
> these two tests while working to find pthread_mutex_lock.
> Could this be a cmake bug?
No, it was my bug. By default, check_symbol_exists only looks in those
libraries that are automatically linked into an executable. I should
have set CMAKE_REQUIRED_LIBRARIES to include pthread. On my platform,
pthread libraries are automatically linked in, so it magically worked.
Thanks for the fix! I've committed it in r74426.
- Doug
More information about the llvm-commits
mailing list