fPIC in gcc - Serbipunk/notes GitHub Wiki

generated machine code is not dependent on being located at a specific address in order to work

it's suitable for inclusion(包括) in a library

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

https://stackoverflow.com/questions/5311515/gcc-fpic-option