On 08/10/2015 01:24 PM, Brad King wrote: > On 08/10/2015 01:21 PM, Chuck Atkins wrote: >> According to the compiler reference manual, -Wl,-a,default will search >> for shared first, then use static if the shared lib is not present. >> Changing this to -Wl,-a,shared will make the search use shared libraries >> exclusively, which is how all the other platforms work. > > Yes. The old flag was probably used due to reference documentation > for ancient HP versions.
It turns out -a,default is correct because the shared-then-static is the behavior we want, and is what -Bdynamic does on other platforms. See discussion here: http://www.cmake.org/Bug/view.php?id=1644#c4927 The _LINK_STATIC_ and _LINK_DYNAMIC_ settings are for requesting that the linker resolve -lfoo as a static library and then switching back to the default shared-then-static behavior. We have never used these to force selection of shared libraries only. A better name for _LINK_DYNAMIC_ would probably have been _LINK_DEFAULT_ but they are internal variables anyway. I simply reverted this part of the topic. -Brad -- 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
