Skip to content

Commit fdbfe59

Browse files
committed
cmake: add -Wno-unused-function to dns_sd_windows.c
We use an external 'mdns.h' in the Windows to do dns-sd for Windows. We don't use all the functions on purpose, so don't warn when we use that file. Set -Werror on Travis and AppVeyor to catch issues on mingw Signed-off-by: Robin Getz <[email protected]>
1 parent 232cedd commit fdbfe59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ if (MSVC)
163163
add_compile_options(/WX)
164164
endif()
165165
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
166-
if(DEFINED ENV{TRAVIS} AND DEFINED ENV{CI})
167-
message(STATUS "Running in a Travis-CI environment, setting -Werror")
166+
if(DEFINED ENV{CI} AND (DEFINED ENV{TRAVIS} OR DEFINED ENV{APPVEYOR}))
167+
message(STATUS "Running in CI environment (Travis or AppVeyor), setting -Werror")
168168
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
169169
endif()
170170
endif()
@@ -307,6 +307,9 @@ if(WITH_NETWORK_BACKEND)
307307
elseif(WIN32)
308308
set(HAVE_DNS_SD ON)
309309
list(APPEND LIBIIO_CFILES dns_sd_windows.c dns_sd.c)
310+
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
311+
set_source_files_properties(dns_sd_windows.c PROPERTIES COMPILE_FLAGS "-Wno-unused-function")
312+
endif()
310313
message(STATUS "Building with mdns, A Public domain mDNS/DNS-SD library in C ")
311314
else()
312315
message(STATUS "Building without DNS-SD (Zeroconf) support")

0 commit comments

Comments
 (0)