From 769bff52d381b2627a1e67039a0ae8af4b33d52c Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Mon, 11 Nov 2024 10:34:12 +0000 Subject: [PATCH] Silence warnings in compilers without [[noreturn]] --- CMake/platforms/android.cmake | 7 +++++++ CMake/platforms/xbox_nxdk.cmake | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/CMake/platforms/android.cmake b/CMake/platforms/android.cmake index 4000bacac..17a358461 100644 --- a/CMake/platforms/android.cmake +++ b/CMake/platforms/android.cmake @@ -29,3 +29,10 @@ set(UBSAN OFF) # Disable in-game options to exit the game. set(NOEXIT ON) + +# NDK C++ compiler does not support [[noreturn]], leading to lots of warnings like this: +# +# warning: non-void function does not return a value in all control paths +# +# Silence them. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type") diff --git a/CMake/platforms/xbox_nxdk.cmake b/CMake/platforms/xbox_nxdk.cmake index 9a0137566..da888ebdb 100644 --- a/CMake/platforms/xbox_nxdk.cmake +++ b/CMake/platforms/xbox_nxdk.cmake @@ -20,3 +20,10 @@ set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(CMAKE_USE_WIN32_THREADS_INIT 0) set(CMAKE_USE_PTHREADS_INIT 1) + +# nxdk C++ compiler does not support [[noreturn]], leading to lots of warnings like this: +# +# warning: non-void function does not return a value in all control paths +# +# Silence them. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type")