Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libnice] Fix build error on Linux #14248

Merged
merged 6 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions ports/libnice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ 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(
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
-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)
Expand Down Expand Up @@ -121,8 +130,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
Expand All @@ -145,4 +160,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()
2 changes: 1 addition & 1 deletion ports/libnice/CONTROL
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,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
Expand Down