[CMake] How to add -fPIC to a static library?

Peter Steinbach steinbach at scionics.de
Mon Aug 29 03:33:20 EDT 2016


AFAIK, there is also a global CMAKE_POSITION_INDEPENDENT_CODE that is 
used to derive the target-specific value of POSITION_INDEPENDENT_CODE. 
If you wanna use fPIC for all your targets, you may wanna consider
set(CMAKE_POSITION_INDEPENDENT_CODE ON).

Best,
P


More information about the CMake mailing list