Skip to content

Commit

Permalink
Fixed Iphlpapi library depend declaration on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris committed Aug 14, 2024
1 parent eb6a84a commit 22fc22b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,10 @@ if (srt_libspec_shared)
if (ENABLE_ENCRYPTION)
target_link_libraries(${TARGET_srt}_shared PRIVATE ${SSL_LIBRARIES})
endif()
if (WIN32 AND ENABLE_LOCALIF_WIN32)
target_link_libraries(${TARGET_srt}_shared PRIVATE Iphlpapi)
add_definitions(-DSRT_ENABLE_LOCALIF_WIN32)
endif()
if (MICROSOFT)
target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib)
if (NOT (ENABLE_ENCRYPTION AND "${USE_ENCLIB}" STREQUAL "botan"))
Expand All @@ -1084,6 +1088,10 @@ endif()

if (srt_libspec_static)
add_library(${TARGET_srt}_static STATIC ${OBJECT_LIB_SUPPORT} ${VIRTUAL_srt})
if (WIN32 AND ENABLE_LOCALIF_WIN32)
target_link_libraries(${TARGET_srt}_static PRIVATE Iphlpapi)
add_definitions(-DSRT_ENABLE_LOCALIF_WIN32)
endif()

# For Windows, leave the name to be "srt_static.lib".
# Windows generates two different library files:
Expand Down

0 comments on commit 22fc22b

Please sign in to comment.