- fix static builds
This commit is contained in:
+10
-2
@@ -360,13 +360,21 @@ endif()
|
|||||||
target_compile_definitions(rtphone PUBLIC ${DEFINES} )
|
target_compile_definitions(rtphone PUBLIC ${DEFINES} )
|
||||||
|
|
||||||
if (TARGET_LINUX)
|
if (TARGET_LINUX)
|
||||||
target_link_options(rtphone PUBLIC -Wl,-Bstatic)
|
# PRIVATE, not PUBLIC: rtphone is a STATIC library, so these link options are
|
||||||
|
# never used to build rtphone itself and must not propagate to consumers.
|
||||||
|
# As PUBLIC they leaked into every consumer's LINK_FLAGS as an adjacent
|
||||||
|
# "-Wl,-Bstatic -Wl,-Bdynamic" pair (the wrapped libraries land in a separate
|
||||||
|
# LINK_LIBRARIES section, so nothing is actually wrapped). The trailing
|
||||||
|
# -Bdynamic forced the linker back into dynamic-search mode, which broke
|
||||||
|
# fully-static consumers (e.g. vq-core built with SERVER_STATIC_LINKING=ON:
|
||||||
|
# "attempted static link of dynamic object libz.so").
|
||||||
|
target_link_options(rtphone PRIVATE -Wl,-Bstatic)
|
||||||
target_compile_options(rtphone PUBLIC -Wno-deprecated -Wno-deprecated-declarations)
|
target_compile_options(rtphone PUBLIC -Wno-deprecated -Wno-deprecated-declarations)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(rtphone PUBLIC ${LIBS_STATIC})
|
target_link_libraries(rtphone PUBLIC ${LIBS_STATIC})
|
||||||
|
|
||||||
if (TARGET_LINUX)
|
if (TARGET_LINUX)
|
||||||
target_link_options(rtphone PUBLIC -Wl,-Bdynamic)
|
target_link_options(rtphone PRIVATE -Wl,-Bdynamic)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(rtphone
|
target_include_directories(rtphone
|
||||||
|
|||||||
Reference in New Issue
Block a user