From 4f490cf1c1b6e23aae6ae2ee9b08b86373539e5e Mon Sep 17 00:00:00 2001 From: Mateo Cindric Date: Sat, 14 Jan 2023 17:08:17 +0000 Subject: [PATCH] interfaces-plugin: add PIC flag to the core static library --- src/interfaces/CMakeLists.txt | 9 ++++++--- src/interfaces/src/plugin/common.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/interfaces/CMakeLists.txt b/src/interfaces/CMakeLists.txt index 6bf46b7e..daf31e74 100644 --- a/src/interfaces/CMakeLists.txt +++ b/src/interfaces/CMakeLists.txt @@ -108,8 +108,12 @@ include_directories( ) # build core library -add_library(${PLUGIN_CORE_LIBRARY_NAME} SHARED ${CORE_SOURCES}) -install(TARGETS ${PLUGIN_CORE_LIBRARY_NAME} DESTINATION lib) +add_library(${PLUGIN_CORE_LIBRARY_NAME} STATIC ${CORE_SOURCES}) +target_compile_options( + ${PLUGIN_CORE_LIBRARY_NAME} + PRIVATE + -fPIC +) # build plugin as a module add_library( @@ -118,7 +122,6 @@ add_library( ${PLUGIN_SOURCES} # ${CORE_SOURCES} ) - target_link_libraries( ${PLUGIN_MODULE_NAME} diff --git a/src/interfaces/src/plugin/common.c b/src/interfaces/src/plugin/common.c index b3430ae3..11a78e0c 100644 --- a/src/interfaces/src/plugin/common.c +++ b/src/interfaces/src/plugin/common.c @@ -1,3 +1,3 @@ #include "common.h" -const char* const PLUGIN_NAME = "ietf-system-plugin"; +const char* const PLUGIN_NAME = "ietf-interfaces-plugin";