Fix unused -pie flag for libs
Summary:
Before cmake 3.14, the -pie linker flag needs to be added manually. It
is currently applied to all targets, despite it is only useful when
linking exectuables. This causes clang to raise a
-Wunused-command-line-argument warning. This diff filters the -pie
flag better to get rid of this warning.
Test Plan:
With clang as a compiler:
ninja all security-check
Check the warning is gone.
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D6281