I noticed when using ADD_LIBRARY to compile both static and shared simultaneously that CMake will compile the source code twice once with -fPIC (for shared build) and once without.

From the point of view of Linux I've never had a problem using code compiled with -fPIC with a static link (except it's slightly bigger). Since compiling the code twice does slow down the build quite a bit, I guess I was just wondering how hard people think it would be to get ADD_LIBRARY(foo STATIC) to somehow reuse code already compiled by ADD_LIBRARY(foo SHARED).

Is this even possible to do within CMakeLists.txt files without making source code modifications?

--
Philip Lowman
Simulation Development Engineer, Modeling and Simulation Technology
General Dynamics Land Systems
http://www.gdls.com
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to