File 0001-fix-build-on-gcc-13.patch of Package multimc

From b0895f2d819cfcf9b4106bf2af636ce0c016c601 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= <sp1rit@disroot.org>
Date: Mon, 10 Apr 2023 13:30:38 +0200
Subject: [PATCH] fix build on gcc 13
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Florian "sp1rit"​ <sp1rit@disroot.org>
---
 CMakeLists.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc1e1eb..b3dcc97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,18 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type -O0")
 # Fix build with Qt 5.13
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
 
+# Fix build with GCC 13
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    # Get the GCC version number
+    execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+
+    # Check if the GCC version is 13 or greater
+    if(GCC_VERSION VERSION_GREATER_EQUAL 13)
+        # Add the "-Wno-c++20-compat" flag to the CXX compiler flags
+        set(CMAKE_CXX_FLAGS " -Wno-c++20-compat ${CMAKE_CXX_FLAGS}")
+    endif()
+endif()
+
 ##################################### Set Application options #####################################
 
 ######## Set URLs ########
-- 
2.40.0
openSUSE Build Service is sponsored by