aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-16 19:34:54 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-16 19:34:54 +0900
commitc641563dda852880fb9f8189b83d02a59aabe17a (patch)
treef3ffd6c9cc85d0b3dc331e28072232fffb5b9912
parent643aa92da416ab7b25c8b406a90007e4e7ebbb41 (diff)
downloadlibquotient-c641563dda852880fb9f8189b83d02a59aabe17a.tar.gz
libquotient-c641563dda852880fb9f8189b83d02a59aabe17a.zip
CMakeLists.txt: Make -Wreturn-type an error
Because a missing return in a non-void function is always an error.
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1cf871a3..e33c4e0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,10 @@ CHECK_CXX_COMPILER_FLAG("-Wpedantic" PEDANTIC_FLAG_SUPPORTED)
if ( PEDANTIC_FLAG_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )pedantic($| )")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
endif ( )
+CHECK_CXX_COMPILER_FLAG("-Werror=return-type" WERROR_FLAG_SUPPORTED)
+if ( WERROR_FLAG_SUPPORTED )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type")
+endif ( )
if ( CMAKE_VERSION VERSION_LESS "3.1" )
CHECK_CXX_COMPILER_FLAG("-std=c++11" STD_FLAG_SUPPORTED)