|
@@ -11,6 +11,7 @@ option(USE_SRTP "Enable SRTP for media support" OFF)
|
|
|
option(NO_WEBSOCKET "Disable WebSocket support" OFF)
|
|
|
option(NO_EXAMPLES "Disable examples" OFF)
|
|
|
option(NO_TESTS "Disable tests build" OFF)
|
|
|
+option(WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
|
|
|
|
|
|
if(USE_NICE)
|
|
|
option(USE_JUICE "Use libjuice" OFF)
|
|
@@ -214,13 +215,19 @@ add_library(LibDataChannel::LibDataChannelStatic ALIAS datachannel-static)
|
|
|
install(TARGETS datachannel LIBRARY DESTINATION lib)
|
|
|
install(FILES ${LIBDATACHANNEL_HEADERS} DESTINATION include/rtc)
|
|
|
|
|
|
-# Warnings as errors
|
|
|
-if(MSVC)
|
|
|
- target_compile_options(datachannel PRIVATE /WX)
|
|
|
- target_compile_options(datachannel-static PRIVATE /WX)
|
|
|
-else()
|
|
|
- target_compile_options(datachannel PRIVATE -Wall -Wextra -Werror)
|
|
|
- target_compile_options(datachannel-static PRIVATE -Wall -Wextra -Werror)
|
|
|
+if(NOT MSVC)
|
|
|
+ target_compile_options(datachannel PRIVATE -Wall -Wextra)
|
|
|
+ target_compile_options(datachannel-static PRIVATE -Wall -Wextra)
|
|
|
+endif()
|
|
|
+
|
|
|
+if(WARNINGS_AS_ERRORS)
|
|
|
+ if(MSVC)
|
|
|
+ target_compile_options(datachannel PRIVATE /WX)
|
|
|
+ target_compile_options(datachannel-static PRIVATE /WX)
|
|
|
+ else()
|
|
|
+ target_compile_options(datachannel PRIVATE -Werror)
|
|
|
+ target_compile_options(datachannel-static PRIVATE -Werror)
|
|
|
+ endif()
|
|
|
endif()
|
|
|
|
|
|
# Tests
|