[libnice] Fix build error on Linux (#14248)

This commit is contained in:
Lily 2020-11-07 05:31:54 +08:00 committed by GitHub
parent 0e1252388d
commit 5a95fe218f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 11 deletions

View File

@ -4,11 +4,18 @@ project(libnice
VERSION 0.1.15)
SET (this_target libnice)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
-DHAVE_OPENSSL
-DPACKAGE_STRING="${PROJECT_VERSION}")
if (WIN32)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
-DHAVE_OPENSSL
-DPACKAGE_STRING="${PROJECT_VERSION}")
else()
add_definitions(
-DHAVE_OPENSSL
-DPACKAGE_STRING="${PROJECT_VERSION}"
-DHAVE_NETDB_H=1)
endif()
configure_file(${CMAKE_SOURCE_DIR}/win32/vs9/config.h ${CMAKE_SOURCE_DIR}/config.h COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/win32/vs9/libnice.def ${CMAKE_SOURCE_DIR}/libnice.def COPYONLY)
@ -121,8 +128,14 @@ SET(HEADERS
./win32/vs9/config.h
)
add_library(libnice ${SRCS} ${HEADERS})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4005 /wd4391 /wd4142 /wd4267")
target_link_libraries(libnice ${IPHLPAPI_LIBRARY} ${WS2_32_LIB} ${ADVAPI32_LIB} ${GLIB_LIBRARY} ${GOBJECT_LIBRARY} ${GIO_LIBRARY} OpenSSL::SSL)
if (MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4005 /wd4391 /wd4142 /wd4267")
endif()
if (WIN32)
target_link_libraries(libnice ${IPHLPAPI_LIBRARY} ${WS2_32_LIB} ${ADVAPI32_LIB} ${GLIB_LIBRARY} ${GOBJECT_LIBRARY} ${GIO_LIBRARY} OpenSSL::SSL)
else()
target_link_libraries(libnice ${GLIB_LIBRARY} ${GOBJECT_LIBRARY} ${GIO_LIBRARY} OpenSSL::SSL)
endif()
install(TARGETS libnice
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
@ -145,4 +158,4 @@ install(FILES stun/usages/ice.h DESTINATION include/stun/usages)
install(FILES stun/usages/timer.h DESTINATION include/stun/usages)
install(FILES stun/usages/turn.h DESTINATION include/stun/usages)
install(FILES stun/win32_common.h DESTINATION include/stun)
endif()
endif()

View File

@ -1,6 +1,6 @@
Source: libnice
Version: 0.1.15
Port-Version: 5
Port-Version: 6
Homepage: https://nice.freedesktop.org
Description: Libnice is an implementation of the IETF's Interactive Connectivity Establishment (ICE) standard (RFC 5245) and the Session Traversal Utilities for NAT (STUN) standard (RFC 5389).
Build-Depends: glib, openssl

View File

@ -730,8 +730,6 @@ libmpeg2:x64-osx=fail
libmpeg2:x64-uwp=fail
libmupdf:x64-osx=fail
libmysql:x86-windows=fail
libnice:x64-linux=fail
libnice:x64-osx=fail
libopenmpt:x64-linux=fail
libopenmpt:x64-osx=fail
libopusenc:arm-uwp=fail