From 6caab60fed7826dff35e6365a6d3166d5cf69cab Mon Sep 17 00:00:00 2001 From: Brian Neradt Date: Wed, 20 Sep 2023 18:24:37 +0000 Subject: [PATCH] cmake: compile jsonrpc_protocol with -fPIC Some plugins link against jsonrpc_protocol and therefore need the library to be compiled as position independent code. --- mgmt/rpc/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mgmt/rpc/CMakeLists.txt b/mgmt/rpc/CMakeLists.txt index 87112543fb6..a2509eb1089 100644 --- a/mgmt/rpc/CMakeLists.txt +++ b/mgmt/rpc/CMakeLists.txt @@ -32,6 +32,10 @@ add_library(jsonrpc_protocol STATIC ) add_library(ts::jsonrpc_protocol ALIAS jsonrpc_protocol) +# Some plugins link against ts::jsonrpc_protocol and therefore need it to be compiled as +# position independent. +set_target_properties(jsonrpc_protocol PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + target_link_libraries(jsonrpc_protocol PUBLIC ts::tscore