Hi there, I'm building some C code into a library. The library needs to link to a C++ static library (IMPORTED target). I'm puzzled by the following:
- with BUILD_SHARED_LIBS=OFF (default), everything works as expected and CMake sees the C library as a "C++ library" (i.e. it uses the C++ compiler/linker to link the two libraries together into a static library). - with BUILD_SHARED_LIBS=ON however, CMake tries to link the C library to the C++ library with cc (clang in my case), and I get linker errors. My questions: *What mechanism does CMake use to determine the linker language, and why is it different in these two cases?* Is it because I want to link a shared library against a static library as opposed to two static ones? Or is BUILD_SHARED_LIBS a red herring? Does CMake have a notion of what linker language to use for IMPORTED targets? I'm looking forward to your answer, Robin
-- 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