Skip to content

Commit 5a7959e

Browse files
authored
Set correct macro for static symbols (AcademySoftwareFoundation#77)
* Set correct macro for static symbols Signed-off-by: BtbN <timo@rothenpieler.org> * Improve oapv.pc for static linking LIB_NAME was not defined, variable is named LIB_NAME_BASE. Signed-off-by: BtbN <timo@rothenpieler.org> --------- Signed-off-by: BtbN <timo@rothenpieler.org>
1 parent 95707ab commit 5a7959e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkgconfig/oapv.pc.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
prefix=@CMAKE_INSTALL_PREFIX@
33
exec_prefix=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@
44
libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
5-
includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@LIB_NAME@
5+
includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@LIB_NAME_BASE@
66

77
Name: oapv
88
Description: Advanced Professional Video Codec
99

1010
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
1111

1212
Requires:
13-
Libs: -L${libdir} -loapv
13+
Libs: -L${libdir} -l@LIB_NAME_BASE@
14+
Libs.private: -L${libdir}/@LIB_NAME_BASE@ -lm
1415

1516
Cflags: -I${includedir}
17+
Cflags.private: -DOAPV_STATIC_DEFINE

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ generate_export_header(${LIB_NAME_BASE}_dynamic
6767
EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/include/oapv/oapv_exports.h)
6868

6969
# This will cause the export macros to expand to nothing when building the static library.
70-
set_target_properties(${LIB_NAME_BASE} PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
70+
target_compile_definitions(${LIB_NAME_BASE} PUBLIC OAPV_STATIC_DEFINE)
7171

7272
source_group("base\\header" FILES ${LIB_BASE_INC} ${LIB_INC})
7373
source_group("base\\source" FILES ${LIB_BASE_SRC} ${LIB_API_SRC})

0 commit comments

Comments
 (0)