cmake: fix static linking winpthread on MINGW
Include linker flags to link winpthread statically on MINGW when static build is on. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
cbd7d7d2d1
commit
d91e5db524
|
@ -469,8 +469,13 @@ if(ENABLE_LINK)
|
|||
set(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${PTHREAD_LIB})
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -lpthread)
|
||||
set(VBAMCORE_LIBS ${VBAMCORE_LIBS} -lpthread)
|
||||
if(NOT VBAM_STATIC)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -lpthread)
|
||||
set(VBAMCORE_LIBS ${VBAMCORE_LIBS} -lpthread)
|
||||
else()
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "-Wl,-Bstatic -lwinpthread -Wl,-Bdynamic")
|
||||
set(VBAMCORE_LIBS ${VBAMCORE_LIBS} "-Wl,-Bstatic -lwinpthread -Wl,-Bdynamic")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckFunctionExists)
|
||||
|
|
Loading…
Reference in New Issue