[CMake] Comaptibility with older gcc

Konstantin Tokarev annulen at yandex.ru
Fri Jan 27 12:14:48 EST 2017



27.01.2017, 20:04, "Michele Portolan" <michele.portolan at grenoble-inp.fr>:
> I have a project that build correctly using gcc 4.9.3, generating a
> dynamic library that I can later link to obtain my executables. So,
> nothing special.
>
> My problem is that on one of my target systems, I only have a gcc 4.1.2
> and I am forced to use it for at least linking the last executable. My
> project uses extensively C++14,so I cannot build it with the older gcc.
>
> Is there a way to have Cmake generate a library that is compatible with
> gcc 4.1.2?

Your issue has nothing to do with cmake, but with used compilers / runtimes.

Your library will be possibly compatible with gcc 4.1 if it is not linked to libstdc++. To achieve this you have to elemeinate all std:: usages or only carefully chosen subset which does npot require linking. You also should not use any std:: types in public API of your library.

>
> Regards,
>
> Michele
> --
>
> 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

-- 
Regards,
Konstantin


More information about the CMake mailing list