mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-09-04 08:09:17 +00:00
Disable MSVC warning 4251 in header rather than in CMakeLists
This commit is contained in:
@ -36,7 +36,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||||
if (MSVC)
|
if(MSVC)
|
||||||
add_definitions(-DNOMINMAX)
|
add_definitions(-DNOMINMAX)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
|
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
|
||||||
@ -247,10 +247,7 @@ add_library(LibDataChannel::LibDataChannelStatic ALIAS datachannel-static)
|
|||||||
install(TARGETS datachannel LIBRARY DESTINATION lib)
|
install(TARGETS datachannel LIBRARY DESTINATION lib)
|
||||||
install(FILES ${LIBDATACHANNEL_HEADERS} DESTINATION include/rtc)
|
install(FILES ${LIBDATACHANNEL_HEADERS} DESTINATION include/rtc)
|
||||||
|
|
||||||
if(MSVC)
|
if(NOT MSVC)
|
||||||
target_compile_options(datachannel PRIVATE /wd4251)
|
|
||||||
target_compile_options(datachannel-static PRIVATE /wd4251)
|
|
||||||
else()
|
|
||||||
target_compile_options(datachannel PRIVATE -Wall -Wextra)
|
target_compile_options(datachannel PRIVATE -Wall -Wextra)
|
||||||
target_compile_options(datachannel-static PRIVATE -Wall -Wextra)
|
target_compile_options(datachannel-static PRIVATE -Wall -Wextra)
|
||||||
endif()
|
endif()
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
#ifndef _WIN32_WINNT
|
#ifndef _WIN32_WINNT
|
||||||
#define _WIN32_WINNT 0x0602 // Windows 8
|
#define _WIN32_WINNT 0x0602 // Windows 8
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4251) // disable "X needs to have dll-interface..."
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define RTC_CPP_EXPORT
|
#define RTC_CPP_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user