From c77040ee1ebc8ef276d11bcff3837690e4d1c04a Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 30 Jun 2022 14:04:12 +0200 Subject: [PATCH] Disable "deprecated-declarations" warning on macos --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 28 +++++++++++++++------------- server/control_session_http.hpp | 1 + 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c3302da..83e7fb2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,7 +134,7 @@ jobs: -DBOOST_ROOT=boost_${BOOST_VERSION} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_FLAGS="-I/usr/local/include -DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14 -Wno-deprecated-declarations" + -DCMAKE_CXX_FLAGS="-I/usr/local/include -DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14" env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - name: build diff --git a/CMakeLists.txt b/CMakeLists.txt index d8dc8595..963a22a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,17 @@ IF (TIDY) ENDIF() ENDIF() +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(MACOSX TRUE) +elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set (FREEBSD TRUE) + if (BUILD_CLIENT) + message(FATAL_ERROR "Snapclient not yet supported for FreeBSD, use \"-DBUILD_CLIENT=OFF\"") + endif() +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android") + set (ANDROID TRUE) +endif() + if (MSVC) # warning level 4 and all warnings as errors @@ -39,6 +50,10 @@ if (MSVC) else() # lots of warnings and all warnings as errors add_compile_options(-Wall -Wextra -pedantic -Wno-unused-function) + if (MACOSX) + add_compile_options(-Wno-deprecated-declarations) + endif() + if (WERROR) add_compile_options(-Werror) endif() @@ -83,19 +98,6 @@ if (NOT BUILD_CLIENT AND NOT BUILD_SERVER) message(FATAL_ERROR "One or both of BUILD_CLIENT or BUILD_SERVER must be set to ON to build") endif() -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(MACOSX TRUE) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - set (FREEBSD TRUE) - if (BUILD_CLIENT) - message(FATAL_ERROR "Snapclient not yet supported for FreeBSD, use \"-DBUILD_CLIENT=OFF\"") - endif() -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android") - set (ANDROID TRUE) -# if (BUILD_SERVER) -# message(FATAL_ERROR "Snapserver not yet supported for Android, use \"-DBUILD_SERVER=OFF\"") -# endif() -endif() # Configure paths if(NOT DEFINED CMAKE_INSTALL_BINDIR) diff --git a/server/control_session_http.hpp b/server/control_session_http.hpp index 8eb234fc..7c33347c 100644 --- a/server/control_session_http.hpp +++ b/server/control_session_http.hpp @@ -24,6 +24,7 @@ // 3rd party headers #include + #if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"