[CMake] Create executable with no dynamic dependency at all

Denis Scherbakov denis_scherbakov at yahoo.com
Thu May 7 07:48:37 EDT 2009


James,

I took a look again at our source and notices, that we set
CMAKE_BUILD_TYPE to Custom, so no default options migrate into our
environment.

I think you receive -Wl,-Bdynamic from
cmake/Modules/Platform/Linux.cmake:25:  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")

My system is Gentoo Linux. Cmake is 2.6.4.

find /usr/share/cmake/Modules/Platform -type f | xargs grep -n -H '\-Wl\,\-Bdynamic'

Denis

> Now the only problem I have is that "-Wl,-Bdynamic
> -Wl,-rpath,/usr/local/lib" is still added to the end
> of the linker
> commandline - which is a bug, since no dynamic libs are
> linked.
> Any ideas how to work-around this or how to track down why
> and where this
> empty "-Wl,-Bdynamic" flag is added?



      


More information about the CMake mailing list