[CMake] CMAKE_{C, CXX}_IMPLICIT_LINK_LIBRARIES being used even though Ada is the current language.

Tom Kacvinsky tom.kacvinsky at vectorcast.com
Fri Jan 3 14:51:47 EST 2014


I figured out what was going on by lots of experimentation.  When we link
an Ada executable, we link in two other libraries, each of which is based
on C/C++ code.  It appears that CMake keeps track of this and adds the
implicit library dependencies you'll have because of this C and C++ code.
That is why these libraries were showing up.  I was able to reproduce this
with a simple CMakeLists.txt file.  I worked around the problem by defining
the implicit library variables to be empty (which will not cause us
problems as the link driver (g++ for C/C++ execs, gnatmake for Ada execs)
adds the right C/C++ run time libraries to the link line.

Tom


On Fri, Jan 3, 2014 at 2:48 PM, Alexander Neundorf
<a.neundorf-work at gmx.net>wrote:

> On Friday 03 January 2014, Tom Kacvinsky wrote:
> > I sent an email yesterday about -lstdc++ showing up on my link line even
> > though I did not request it.  And I was getting -lc and -lm multiple
> times.
> >
> > After much digging, I tracked it down to
> CMAKE_CXX_IMPLICIT_LINK_LIBRARIES
> > and CMAKE_C_IMPLICIT_LINK_LIBRARIES being added to the link line, even
> > though the language in effect is Ada (as set up by the PLPlot Ada support
> > CMake moduels).
> >
> > My question is why are these added?  Is this done by default in cmake, or
> > is this a deficiency in the Ada support modules?
>
> Ada support is not part of cmake, so it's probably an issue with the Ada
> files.
>
> Alex
>
> --
>
> 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://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140103/79e72008/attachment.htm>


More information about the CMake mailing list