From 5d4e5f67a44a941ea7df9226f75d64411316454a Mon Sep 17 00:00:00 2001 From: BtbN Date: Tue, 6 May 2025 16:27:10 +0200 Subject: [PATCH 1/2] Set correct macro for static symbols Signed-off-by: BtbN --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ee8fec7..6854c77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,7 +64,7 @@ generate_export_header(${LIB_NAME_BASE}_dynamic EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/include/oapv/oapv_exports.h) # This will cause the export macros to expand to nothing when building the static library. -set_target_properties(${LIB_NAME_BASE} PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE) +target_compile_definitions(${LIB_NAME_BASE} PUBLIC OAPV_STATIC_DEFINE) source_group("base\\header" FILES ${LIB_BASE_INC} ${LIB_INC}) source_group("base\\source" FILES ${LIB_BASE_SRC} ${LIB_API_SRC}) From 9866c91149408a51219efda147872018279ae5bb Mon Sep 17 00:00:00 2001 From: BtbN Date: Tue, 6 May 2025 16:38:42 +0200 Subject: [PATCH 2/2] Improve oapv.pc for static linking LIB_NAME was not defined, variable is named LIB_NAME_BASE. Signed-off-by: BtbN --- pkgconfig/oapv.pc.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgconfig/oapv.pc.in b/pkgconfig/oapv.pc.in index 27654fc..a66c3c0 100644 --- a/pkgconfig/oapv.pc.in +++ b/pkgconfig/oapv.pc.in @@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@ libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@LIB_NAME@ +includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@LIB_NAME_BASE@ Name: oapv Description: Advanced Professional Video Codec @@ -10,6 +10,8 @@ Description: Advanced Professional Video Codec Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ Requires: -Libs: -L${libdir} -loapv +Libs: -L${libdir} -l@LIB_NAME_BASE@ +Libs.private: -L${libdir}/@LIB_NAME_BASE@ -lm Cflags: -I${includedir} +Cflags.private: -DOAPV_STATIC_DEFINE