diff --git a/CMakeLists.txt b/CMakeLists.txt index cb42b665..b48b183a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,11 @@ if (BIICODE) endif () add_library(cppformat ${FMT_SOURCES}) +if (BUILD_SHARED_LIBS) + # Fix rpmlint warning: + # unused-direct-shlib-dependency /usr/lib/libformat.so.1.1.0 /lib/libm.so.6. + target_link_libraries(cppformat -Wl,--as-needed) +endif () if (FMT_PEDANTIC AND CMAKE_COMPILER_IS_GNUCXX) set_target_properties(cppformat PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wshadow -pedantic")