From 0f7afe7b8e275bb09680f360c58fa9b10a5b5774 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 21 Oct 2013 15:56:35 +0000 Subject: [PATCH] Patch by GM: Turn off 'deprecated' warnings when building with MSVC, and add '-Werror=return-type' to catch funtions that aren't returning what they should. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193088 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 682757aa..31274dc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,7 +196,9 @@ endmacro() # Get warning flags if (NOT MSVC) append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_WALL_FLAG -Wall) + set(LIBCXX_CXX_REQUIRED_FLAGS, -Werror=return-type) endif() + append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_W_FLAG -W) append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter) append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_WWRITE_STRINGS_FLAG -Wwrite-strings) @@ -253,6 +255,10 @@ if (NOT LIBCXX_ENABLE_SHARED) endif() # This is the _ONLY_ place where add_definitions is called. +if (MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + add_definitions( ${LIBCXX_CXX_REQUIRED_FLAGS} ${LIBCXX_CXX_WARNING_FLAGS}