mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Added cmake flag for warnings as errors
This commit is contained in:
4
.github/workflows/build-gnutls.yml
vendored
4
.github/workflows/build-gnutls.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- name: submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: cmake
|
||||
run: cmake -B build -DUSE_GNUTLS=1
|
||||
run: cmake -B build -DUSE_GNUTLS=1 -DWARNINGS_AS_ERRORS=1
|
||||
- name: make
|
||||
run: (cd build; make -j2)
|
||||
- name: test
|
||||
@ -30,7 +30,7 @@ jobs:
|
||||
- name: submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: cmake
|
||||
run: cmake -B build -DUSE_GNUTLS=1
|
||||
run: cmake -B build -DUSE_GNUTLS=1 -DWARNINGS_AS_ERRORS=1
|
||||
- name: make
|
||||
run: (cd build; make -j2)
|
||||
- name: test
|
||||
|
2
.github/workflows/build-nice.yml
vendored
2
.github/workflows/build-nice.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- name: submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: cmake
|
||||
run: cmake -B build -DUSE_GNUTLS=1 -DUSE_NICE=1
|
||||
run: cmake -B build -DUSE_GNUTLS=1 -DUSE_NICE=1 -DWARNINGS_AS_ERRORS=1
|
||||
- name: make
|
||||
run: (cd build; make -j2)
|
||||
- name: test
|
||||
|
6
.github/workflows/build-openssl.yml
vendored
6
.github/workflows/build-openssl.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- name: submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: cmake
|
||||
run: cmake -B build -DUSE_GNUTLS=0
|
||||
run: cmake -B build -DUSE_GNUTLS=0 -DWARNINGS_AS_ERRORS=1
|
||||
- name: make
|
||||
run: (cd build; make -j2)
|
||||
- name: test
|
||||
@ -30,7 +30,7 @@ jobs:
|
||||
- name: submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: cmake
|
||||
run: cmake -B build -DUSE_GNUTLS=0
|
||||
run: cmake -B build -DUSE_GNUTLS=0 -WARNINGS_AS_ERRORS=1
|
||||
env:
|
||||
OPENSSL_ROOT_DIR: /usr/local/opt/openssl
|
||||
OPENSSL_LIBRARIES: /usr/local/opt/openssl/lib
|
||||
@ -48,7 +48,7 @@ jobs:
|
||||
- name: submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: cmake
|
||||
run: cmake -B build -G "NMake Makefiles" -DUSE_GNUTLS=0
|
||||
run: cmake -B build -G "NMake Makefiles" -DUSE_GNUTLS=0 -WARNINGS_AS_ERRORS=1
|
||||
- name: nmake
|
||||
run: |
|
||||
cd build
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user