From 4807c779a71e4cb7eeb99fb6f5e4db614ca97511 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 26 Oct 2022 16:42:44 -0600 Subject: [PATCH] Apply warnings to install test Because the install test project can't access SFML CMake functions, these warnings are only applied when building the install tests as a part of SFML. --- test/CMakeLists.txt | 1 + test/install/Install.cpp | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 74956896..fe1af838 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,6 +14,7 @@ get_target_property(DOCTEST_INCLUDE_DIRS doctest INTERFACE_INCLUDE_DIRECTORIES) target_include_directories(doctest SYSTEM INTERFACE ${DOCTEST_INCLUDE_DIRS}) add_subdirectory(install) +set_target_warnings(test-sfml-install) add_library(sfml-test-main STATIC TestUtilities/SystemUtil.hpp diff --git a/test/install/Install.cpp b/test/install/Install.cpp index 51d58336..1647827a 100644 --- a/test/install/Install.cpp +++ b/test/install/Install.cpp @@ -6,32 +6,32 @@ int main() { // Audio - sf::InputSoundFile input_sound_file; - sf::Listener listener; - sf::Music music; - sf::Sound sound; + [[maybe_unused]] sf::InputSoundFile inputSoundFile; + [[maybe_unused]] sf::Listener listener; + [[maybe_unused]] sf::Music music; + [[maybe_unused]] sf::Sound sound; // Graphics - sf::Color color; - sf::Font font; - sf::RenderWindow render_window; - sf::Sprite sprite; - sf::Vertex vertex; + [[maybe_unused]] sf::Color color; + [[maybe_unused]] sf::Font font; + [[maybe_unused]] sf::RenderWindow renderWindow; + [[maybe_unused]] sf::Sprite sprite; + [[maybe_unused]] sf::Vertex vertex; // Network - sf::Ftp ftp; - sf::Http http; - sf::Packet packet; - sf::UdpSocket udp_socket; + [[maybe_unused]] sf::Ftp ftp; + [[maybe_unused]] sf::Http http; + [[maybe_unused]] sf::Packet packet; + [[maybe_unused]] sf::UdpSocket udpSocket; // System - sf::Angle angle; - sf::FileInputStream file_input_stream; - sf::String string; - sf::Time time; + [[maybe_unused]] sf::Angle angle; + [[maybe_unused]] sf::FileInputStream fileInputStream; + [[maybe_unused]] sf::String string; + [[maybe_unused]] sf::Time time; // Window - sf::Context context; - sf::VideoMode video_mode; - sf::Window window; + [[maybe_unused]] sf::Context context; + [[maybe_unused]] sf::VideoMode videoMode; + [[maybe_unused]] sf::Window window; }