Rather than dealing directly with compiler flags, it’s more idiomatic to set the POSITION_INDEPENDENT_CODE
property on each target that requires it:
set_target_properties(myplugin PROPERTIES POSITION_INDEPENDENT_CODE ON)
Note that the plugin wrappers, shared code target, and binary data targets will all require this property to be set.