Skip to content

Commit

Permalink
Disable "deprecated-declarations" warning on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Jun 30, 2022
1 parent 90a7206 commit c77040e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions server/control_session_http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

// 3rd party headers
#include <boost/beast/core.hpp>

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Expand Down

0 comments on commit c77040e

Please sign in to comment.