From 6add0cbfecfed4603b116af9a9033f447e2aecc6 Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Mon, 16 Sep 2024 17:22:51 +0200 Subject: [PATCH] force -Werror=return-type on mods --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36f390d7..588ac3e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,6 +212,11 @@ if (WIN32) endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # force an error on a missing return type, as this is unfortunately a common mistake people make + target_compile_options(${PROJECT_NAME} INTERFACE -Werror=return-type) +endif() + # if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # set_property(TARGET ${PROJECT_NAME} PROPERTY LINKER_TYPE LLD) # target_link_options(${PROJECT_NAME} INTERFACE -fuse-ld=lld)