From f70e47c5c3b2451db4e289d3fb8a705052d8c703 Mon Sep 17 00:00:00 2001 From: fduncanh Date: Sun, 1 Aug 2021 17:11:43 -0400 Subject: [PATCH] silence avah_compat nag with AVAHI_COMPAT_NOWARN=1 uses putenv; conditional compilation set in CMakelists.txt --- CMakeLists.txt | 2 ++ uxplay.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 179b672..9d9c894 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ project(uxplay) set (CMAKE_CXX_STANDARD 11) +add_definitions(-DAVAHI_COMPAT_NOWARN) + find_package(X11 REQUIRED) link_libraries(${X11_LIBRARIES}) include_directories(${X11_INCLUDE_DIR}) diff --git a/uxplay.cpp b/uxplay.cpp index 9d97c2a..340aae3 100755 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -106,6 +106,12 @@ int main(int argc, char *argv[]) { bool use_audio = true; bool debug_log = DEFAULT_DEBUG_LOG; +#ifdef AVAHI_COMPAT_NOWARN + //suppress avahi_compat nag message + char avahi_compat_nowarn[] = "AVAHI_COMPAT_NOWARN==1"; + putenv(avahi_compat_nowarn); +#endif + // Parse arguments for (int i = 1; i < argc; i++) { std::string arg(argv[i]);