Skip to content

Commit

Permalink
Iclude boost as system headers to suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Dec 20, 2024
1 parent 06f1c7d commit 0b1b1e3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 71 deletions.
24 changes: 12 additions & 12 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ set(CLIENT_SOURCES

set(CLIENT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${ATOMIC_LIBRARY} common)

set(CLIENT_INCLUDE ${Boost_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/client
${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/client)

include_directories(SYSTEM ${Boost_INCLUDE_DIR})

if(MACOSX)
# Bonjour
Expand Down Expand Up @@ -44,20 +45,20 @@ elseif(NOT ANDROID)
if(AVAHI_FOUND)
list(APPEND CLIENT_SOURCES browseZeroConf/browse_avahi.cpp)
list(APPEND CLIENT_LIBRARIES ${AVAHI_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${AVAHI_INCLUDE_DIRS})
include_directories(${AVAHI_INCLUDE_DIRS})
endif(AVAHI_FOUND)

# ALSA
if(ALSA_FOUND)
list(APPEND CLIENT_SOURCES player/alsa_player.cpp)
list(APPEND CLIENT_LIBRARIES ${ALSA_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${ALSA_INCLUDE_DIRS})
include_directories(${ALSA_INCLUDE_DIRS})
endif(ALSA_FOUND)

if(PULSE_FOUND)
list(APPEND CLIENT_SOURCES player/pulse_player.cpp)
list(APPEND CLIENT_LIBRARIES ${PULSE_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${PULSE_INCLUDE_DIRS})
include_directories(${PULSE_INCLUDE_DIRS})
endif(PULSE_FOUND)
endif(MACOSX)

Expand All @@ -79,43 +80,42 @@ else()
# Tremor (fixed-point) or libvorbis (floating-point)
if(TREMOR_FOUND)
list(APPEND CLIENT_LIBRARIES ${TREMOR_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${TREMOR_INCLUDE_DIRS})
include_directories(${TREMOR_INCLUDE_DIRS})
elseif(VORBIS_FOUND)
list(APPEND CLIENT_LIBRARIES ${VORBIS_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${VORBIS_INCLUDE_DIRS})
include_directories(${VORBIS_INCLUDE_DIRS})
link_directories(${VORBIS_LIBRARY_DIRS})
endif(TREMOR_FOUND)

# if OGG then tremor or vorbis
if(OGG_FOUND)
list(APPEND CLIENT_SOURCES decoder/ogg_decoder.cpp)
list(APPEND CLIENT_LIBRARIES ${OGG_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${OGG_INCLUDE_DIRS})
include_directories(${OGG_INCLUDE_DIRS})
link_directories(${OGG_LIBRARY_DIRS})
endif(OGG_FOUND)

if(FLAC_FOUND)
list(APPEND CLIENT_SOURCES decoder/flac_decoder.cpp)
list(APPEND CLIENT_LIBRARIES ${FLAC_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${FLAC_INCLUDE_DIRS})
include_directories(${FLAC_INCLUDE_DIRS})
link_directories(${FLAC_LIBRARY_DIRS})
endif(FLAC_FOUND)

if(OPUS_FOUND)
list(APPEND CLIENT_SOURCES decoder/opus_decoder.cpp)
list(APPEND CLIENT_LIBRARIES ${OPUS_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${OPUS_INCLUDE_DIRS})
include_directories(${OPUS_INCLUDE_DIRS})
link_directories(${OPUS_LIBRARY_DIRS})
endif(OPUS_FOUND)

if(SOXR_FOUND)
list(APPEND CLIENT_LIBRARIES ${SOXR_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${SOXR_INCLUDE_DIRS})
include_directories(${SOXR_INCLUDE_DIRS})
link_directories(${SOXR_LIBRARY_DIRS})
endif(SOXR_FOUND)
endif()

include_directories(${CLIENT_INCLUDE})
if(ANDROID)
add_executable(libsnapclient.so ${CLIENT_SOURCES})
target_link_libraries(libsnapclient.so ${CLIENT_LIBRARIES} log OpenSLES)
Expand Down
8 changes: 0 additions & 8 deletions client/player/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,10 @@

// 3rd party headers
#ifdef SUPPORTS_VOLUME_SCRIPT
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-braces"
#pragma GCC diagnostic ignored "-Wnarrowing"
#pragma GCC diagnostic ignored "-Wc++11-narrowing"
#include <boost/process/args.hpp>
#include <boost/process/async.hpp>
#include <boost/process/child.hpp>
#include <boost/process/exe.hpp>
#pragma GCC diagnostic pop
#endif

// standard headers
Expand Down
23 changes: 12 additions & 11 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ set(SERVER_SOURCES

set(SERVER_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${ATOMIC_LIBRARY} common)

set(SERVER_INCLUDE ${Boost_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/server
${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/server)

include_directories(SYSTEM ${Boost_INCLUDE_DIR})


if(ANDROID)
find_package(vorbis REQUIRED CONFIG)
list(APPEND SERVER_LIBRARIES boost::boost)
Expand All @@ -52,7 +54,7 @@ else()
if(AVAHI_FOUND)
list(APPEND SERVER_SOURCES publishZeroConf/publish_avahi.cpp)
list(APPEND SERVER_LIBRARIES ${AVAHI_LIBRARIES})
list(APPEND SERVER_INCLUDE ${AVAHI_INCLUDE_DIRS})
include_directories(${AVAHI_INCLUDE_DIRS})
endif(AVAHI_FOUND)

if(BONJOUR_FOUND)
Expand All @@ -67,7 +69,7 @@ else()
list(APPEND SERVER_SOURCES encoder/ogg_encoder.cpp)
list(APPEND SERVER_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISENC_LIBRARIES}
${OGG_LIBRARIES})
list(APPEND SERVER_INCLUDE ${OGG_INCLUDE_DIRS} ${VORBIS_INCLUDE_DIRS}
include_directories(${OGG_INCLUDE_DIRS} ${VORBIS_INCLUDE_DIRS}
${VORBISENC_INCLUDE_DIRS})
link_directories(${VORBIS_LIBRARY_DIRS})
link_directories(${VORBISENC_LIBRARY_DIRS})
Expand All @@ -80,46 +82,45 @@ else()
if(FLAC_FOUND)
list(APPEND SERVER_SOURCES encoder/flac_encoder.cpp)
list(APPEND SERVER_LIBRARIES ${FLAC_LIBRARIES})
list(APPEND SERVER_INCLUDE ${FLAC_INCLUDE_DIRS})
include_directories(${FLAC_INCLUDE_DIRS})
link_directories(${FLAC_LIBRARY_DIRS})
endif(FLAC_FOUND)

if(OPUS_FOUND)
list(APPEND SERVER_SOURCES encoder/opus_encoder.cpp)
list(APPEND SERVER_LIBRARIES ${OPUS_LIBRARIES})
list(APPEND SERVER_INCLUDE ${OPUS_INCLUDE_DIRS})
include_directories(${OPUS_INCLUDE_DIRS})
link_directories(${OPUS_LIBRARY_DIRS})
endif(OPUS_FOUND)

if(ALSA_FOUND)
list(APPEND SERVER_SOURCES streamreader/alsa_stream.cpp)
list(APPEND SERVER_LIBRARIES ${ALSA_LIBRARIES})
list(APPEND SERVER_INCLUDE ${ALSA_INCLUDE_DIRS})
include_directories(${ALSA_INCLUDE_DIRS})
endif(ALSA_FOUND)

if(JACK_FOUND)
list(APPEND SERVER_SOURCES streamreader/jack_stream.cpp)
list(APPEND SERVER_LIBRARIES ${JACK_LIBRARIES})
list(APPEND SERVER_INCLUDE ${JACK_INCLUDE_DIRS})
include_directories(${JACK_INCLUDE_DIRS})
endif(JACK_FOUND)

if(EXPAT_FOUND)
list(APPEND SERVER_LIBRARIES ${EXPAT_LIBRARIES})
list(APPEND SERVER_INCLUDE ${EXPAT_INCLUDE_DIRS})
include_directories(${EXPAT_INCLUDE_DIRS})
link_directories(${EXPAT_LIBRARY_DIRS})
endif(EXPAT_FOUND)

if(SOXR_FOUND)
list(APPEND SERVER_LIBRARIES ${SOXR_LIBRARIES})
list(APPEND SERVER_INCLUDE ${SOXR_INCLUDE_DIRS})
include_directories(${SOXR_INCLUDE_DIRS})
link_directories(${SOXR_LIBRARY_DIRS})
endif(SOXR_FOUND)
endif()

# list(APPEND SERVER_LIBRARIES Boost::boost)
list(APPEND SERVER_LIBRARIES OpenSSL::Crypto OpenSSL::SSL)

include_directories(${SERVER_INCLUDE})
if(ANDROID)
add_executable(libsnapserver.so ${SERVER_SOURCES})
target_link_libraries(libsnapserver.so ${SERVER_LIBRARIES} log)
Expand Down
6 changes: 0 additions & 6 deletions server/control_session_http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@
#include <boost/asio/ssl.hpp>
#include <boost/beast/core.hpp>
#include <boost/beast/ssl.hpp>

#pragma GCC diagnostic push
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <boost/beast/websocket.hpp>
#pragma GCC diagnostic pop

// standard headers
#include <deque>
Expand Down
15 changes: 0 additions & 15 deletions server/control_session_ws.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,8 @@
#include "control_session.hpp"

// 3rd party headers
#pragma GCC diagnostic push
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <boost/asio/strand.hpp>
#pragma GCC diagnostic pop

#pragma GCC diagnostic push
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <boost/beast/core.hpp>
#pragma GCC diagnostic pop
#include <boost/beast/ssl.hpp>
#include <boost/beast/websocket.hpp>

Expand Down
7 changes: 0 additions & 7 deletions server/stream_session_ws.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@

// 3rd party headers
#include <boost/asio/strand.hpp>
#pragma GCC diagnostic push
#ifdef __clang__
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include <boost/beast/core.hpp>
#pragma GCC diagnostic pop
#include <boost/beast/ssl.hpp>
#include <boost/beast/websocket.hpp>

Expand Down
12 changes: 0 additions & 12 deletions server/streamreader/stream_control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,7 @@
#include "server_settings.hpp"

// 3rd party headers
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-braces"
#pragma GCC diagnostic ignored "-Wnarrowing"
#pragma GCC diagnostic ignored "-Wc++11-narrowing"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <boost/process.hpp>
#pragma GCC diagnostic pop
#include <boost/asio/any_io_executor.hpp>

// standard headers
Expand Down

0 comments on commit 0b1b1e3

Please sign in to comment.