From 83a9b028099788877102132da6c32ea1e3b9377e Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Wed, 15 Jan 2025 13:42:10 +0900 Subject: [PATCH] Remove unnecessary linker flag on libsyscommon.pc The linker flags pulled in by the variable SYSCOMMON_LIBS caused problem when the libsyscommon was linked to another program. The program might have located the libsyscommon by libsyscommon.pc. Because of this, the program might have added linker flags unintentionally that were, in fact, dependent to the libsyscommon, not the program itself. And this causes build error like: ld: cannot find -lcynara-creds-pid: No such file or directory The program didn't intend to link it to libcynara-creds-pid, and therefore the rpmbuild would also not have installed the library. But the linker flag -lcynara-creds-pid was pulled in by the libsyscommon.pc, so it makes build error. Change-Id: I81c2e4544f1c904527e4015aafb28ef0b2a659e9 Signed-off-by: Youngjae Cho --- CMakeLists.txt | 4 ---- libsyscommon.pc.in | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87314e3..5412f1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,10 +61,6 @@ FOREACH(flag ${syscommon_INCLUDE_DIRS}) SET(SYSCOMMON_INCLUDEDIR "${SYSCOMMON_INCLUDEDIR} -I${flag}") ENDFOREACH(flag) -FOREACH(flag ${syscommon_LIBRARIES}) - SET(SYSCOMMON_LIBS "${SYSCOMMON_LIBS} -l${flag}") -ENDFOREACH(flag) - CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) diff --git a/libsyscommon.pc.in b/libsyscommon.pc.in index 7f29eb3..3cfd5d6 100644 --- a/libsyscommon.pc.in +++ b/libsyscommon.pc.in @@ -14,4 +14,4 @@ Description: system common library Version: @VERSION@ Requires.private: gio-2.0 gio-unix-2.0 dlog json-c capi-system-info Cflags: -I${includedir} @SYSCOMMON_INCLUDEDIR@ -Libs: -L${libdir} -lsyscommon @SYSCOMMON_LIBS@ +Libs: -L${libdir} -lsyscommon -- 2.34.1