[CMake] Suppressing -rdynamic
Filip Brcic
brcha at users.sourceforge.net
Sat Oct 6 11:52:16 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Дана субота 06 октобар 2007, Gonzalo Garramuño је написао(ла):
> Filip Brcic wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Дана субота 06 октобар 2007, Gonzalo Garramuño је написао(ла):
> >>> Therefore, you have to override CMAKE_SHARED_LIBRARY_LINK_C_FLAGS and
> >>> set it to blank. Something like:
> >>>
> >>> SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
>
> CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS seems to be the key for c++. Have
> not been able to guess where that is set thou.
Yes, you are right. I made a new "advanced" version of my helloWorld++ (tm)
program using C++ (and cout for output) and it did include -rdynamic when
linking. But, after I added set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") the
problem dissapeared. Nice catch :)
And, here is where that is comming from:
[brcha at sirius Modules]$ grep CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS *
CMakeCXXInformation.cmake:IF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
CMakeCXXInformation.cmake: SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
CMakeCXXInformation.cmake:ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
Since that is evaluated in enable_language(CXX) (I guess), it uses the system
CMAKE_SHARED_LIBRARY_LINK_C_FLAGS variable and not the CMakeFiles.txt
version. For Fortran you should override
CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS in the same way.
- --
Filip Brcic <brcha at users.sourceforge.net>
WWWeb: http://purl.org/NET/brcha/home/
Jabber: brcha at kdetalk.net
ICQ# 40994923
Yahoo! brcha
MSN: brcha at users.sourceforge.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFHB68yeugpoxYs6H8RAiRSAJ494iWTcacqdf3ocJV+GqsH52appgCeJ679
VA9XwuAU4M/vi+OpIP9DdyY=
=raJ3
-----END PGP SIGNATURE-----
More information about the CMake
mailing list