On Tue, Nov 25, 2014 at 11:41:46AM -0500, Brad King wrote: > On 11/21/2014 02:59 PM, Chuck Atkins wrote: > > dlopen defined in dlfcn.h is part of POSIX so generally if you're > > on a *nix system then you can rely on it being there. The associated > > library, however, is a different story, hence CMAKE_DL_LIBS. > > My initial reaction to Roger's post was to say that CMAKE_DL_LIBS was > created very early in CMake and I think a module like FindLibDl would > supersede it. However, Chuck raises a valid point. The dlfcn.h header > may be in a toolchain-defined path so "finding" it ourselves may get > the wrong one. We don't have find modules for "unistd.h" for example. > > Perhaps it is simplest to update the documentation of CMAKE_DL_LIBS > to explain this.
I don't have a problem with using CMAKE_DL_LIBS, but I am reluctant to use it unconditionally. While it's true that most current unix systems support it, looking at POSIX.1-2001 it's in XSI as an optional interface so isn't strictly guaranteed to be present. It would be really nice to have an an accompanying variable e.g. CMAKE_DL_FOUND which confirms that it's safe to use, since I can't infer this from an empty CMAKE_DL_LIBS when it's part of the standard library. It would be equally nice to know if common-but-nonstandard extensions such as dladdr(3) were safe to use. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools `- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
