force Linux static builds to only use static dependencies

master
Dan Bryant 2022-03-30 15:41:23 +01:00
parent 951b7318e4
commit d4170b0ac5
1 changed files with 2 additions and 0 deletions

View File

@ -110,6 +110,8 @@ SET(THREADSLIB Threads::Threads)
if(TSMUXER_STATIC_BUILD)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message("-- Static Linux build, will link whole pthread!")
set_target_properties(tsmuxer PROPERTIES LINK_SEARCH_START_STATIC 1)
set_target_properties(tsmuxer PROPERTIES LINK_SEARCH_END_STATIC 1)
SET(THREADSLIB -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive)
endif()
endif()