[libcxx] r193088 - 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.
Marshall Clow
mclow.lists at gmail.com
Mon Oct 21 08:56:35 PDT 2013
Author: marshall
Date: Mon Oct 21 10:56:35 2013
New Revision: 193088
URL: http://llvm.org/viewvc/llvm-project?rev=193088&view=rev
Log:
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.
Modified:
libcxx/trunk/CMakeLists.txt
Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=193088&r1=193087&r2=193088&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Mon Oct 21 10:56:35 2013
@@ -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}
More information about the cfe-commits
mailing list