[libcxxabi] r212768 - Make cmake cxxflags match those in lib/buildit.

Dan Albert danalbert at google.com
Thu Jul 10 15:23:03 PDT 2014


Author: danalbert
Date: Thu Jul 10 17:23:03 2014
New Revision: 212768

URL: http://llvm.org/viewvc/llvm-project?rev=212768&view=rev
Log:
Make cmake cxxflags match those in lib/buildit.

Modified:
    libcxxabi/trunk/CMakeLists.txt
    libcxxabi/trunk/cmake/config-ix.cmake

Modified: libcxxabi/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=212768&r1=212767&r2=212768&view=diff
==============================================================================
--- libcxxabi/trunk/CMakeLists.txt (original)
+++ libcxxabi/trunk/CMakeLists.txt Thu Jul 10 17:23:03 2014
@@ -158,18 +158,27 @@ if (NOT LIBCXXABI_HAS_STDCXX11_FLAG)
 endif()
 
 list(APPEND LIBCXXABI_CXX_REQUIRED_FLAGS -std=c++11)
+append_if(LIBCXXABI_CXX_REQUIRED_FLAGS LIBCXXABI_HAS_WERROR_FLAG -Werror=return-type)
 
 # Get warning flags
-if (NOT MSVC)
-  append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WALL_FLAG -Wall)
-  append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG -Wno-unused-function)
-  list(APPEND LIBCXXABI_CXX_REQUIRED_FLAGS -Werror=return-type)
-endif()
-
 append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_W_FLAG -W)
-append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WALL_FLAG -Wall)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WCHAR_SUBSCRIPTS_FLAG -Wchar-subscripts)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WCONVERSION_FLAG -Wconversion)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WMISMATCHED_TAGS_FLAG -Wmismatched-tags)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WMISSING_BRACES_FLAG -Wmissing-braces)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WNEWLINE_EOF_FLAG -Wnewline-eof)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG -Wno-unused-function)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WSHADOW_FLAG -Wshadow)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WSHORTEN_64_TO_32_FLAG -Wshorten-64-to-32)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WSIGN_COMPARE_FLAG -Wsign-compare)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WSIGN_CONVERSION_FLAG -Wsign-conversion)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WSTRICT_ALIASING_FLAG -Wstrict-aliasing=2)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WSTRICT_OVERFLOW_FLAG -Wstrict-overflow=4)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WUNUSED_PARAMETER_FLAG -Wunused-parameter)
+append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WUNUSED_VARIABLE_FLAG -Wunused-variable)
 append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WWRITE_STRINGS_FLAG -Wwrite-strings)
-append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WNO_LONG_LONG_FLAG -Wno-long-long)
+
 if (LIBCXXABI_ENABLE_WERROR)
   append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WERROR_FLAG -Werror)
   append_if(LIBCXXABI_CXX_WARNING_FLAGS LIBCXXABI_HAS_WX_FLAG -WX)
@@ -185,6 +194,7 @@ endif()
 # Exceptions
 # Catches C++ exceptions only and tells the compiler to assume that extern C
 # functions never throw a C++ exception.
+append_if(LIBCXXABI_CXX_FEATURE_FLAGS LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG -fstrict-aliasing)
 append_if(LIBCXXABI_CXX_FEATURE_FLAGS LIBCXXABI_HAS_EHSC_FLAG -EHsc)
 
 # Assert

Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=212768&r1=212767&r2=212768&view=diff
==============================================================================
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Thu Jul 10 17:23:03 2014
@@ -4,18 +4,29 @@ include(CheckCXXCompilerFlag)
 # Check compiler flags
 check_cxx_compiler_flag(-std=c++11            LIBCXXABI_HAS_STDCXX11_FLAG)
 check_cxx_compiler_flag(-fPIC                 LIBCXXABI_HAS_FPIC_FLAG)
+check_cxx_compiler_flag(-fstrict-aliasing     LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG)
 check_cxx_compiler_flag(-nodefaultlibs        LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
 check_cxx_compiler_flag(-nostdinc++           LIBCXXABI_HAS_NOSTDINCXX_FLAG)
 check_cxx_compiler_flag(-Wall                 LIBCXXABI_HAS_WALL_FLAG)
 check_cxx_compiler_flag(-W                    LIBCXXABI_HAS_W_FLAG)
 check_cxx_compiler_flag(-Wno-unused-function  LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG)
-check_cxx_compiler_flag(-Wno-unused-parameter LIBCXXABI_HAS_WNO_UNUSED_PARAMETER_FLAG)
+check_cxx_compiler_flag(-Wunused-variable     LIBCXXABI_HAS_WUNUSED_VARIABLE_FLAG)
+check_cxx_compiler_flag(-Wunused-parameter    LIBCXXABI_HAS_WUNUSED_PARAMETER_FLAG)
+check_cxx_compiler_flag(-Wstrict-aliasing     LIBCXXABI_HAS_WSTRICT_ALIASING_FLAG)
+check_cxx_compiler_flag(-Wstrict-overflow     LIBCXXABI_HAS_WSTRICT_OVERFLOW_FLAG)
 check_cxx_compiler_flag(-Wwrite-strings       LIBCXXABI_HAS_WWRITE_STRINGS_FLAG)
-check_cxx_compiler_flag(-Wno-long-long        LIBCXXABI_HAS_WNO_LONG_LONG_FLAG)
+check_cxx_compiler_flag(-Wchar-subscripts     LIBCXXABI_HAS_WCHAR_SUBSCRIPTS_FLAG)
+check_cxx_compiler_flag(-Wmismatched-tags     LIBCXXABI_HAS_WMISMATCHED_TAGS_FLAG)
+check_cxx_compiler_flag(-Wmissing-braces      LIBCXXABI_HAS_WMISSING_BRACES_FLAG)
+check_cxx_compiler_flag(-Wshorten-64-to-32    LIBCXXABI_HAS_WSHORTEN_64_TO_32_FLAG)
+check_cxx_compiler_flag(-Wsign-conversion     LIBCXXABI_HAS_WSIGN_CONVERSION_FLAG)
+check_cxx_compiler_flag(-Wsign-compare        LIBCXXABI_HAS_WSIGN_COMPARE_FLAG)
+check_cxx_compiler_flag(-Wshadow              LIBCXXABI_HAS_WSHADOW_FLAG)
+check_cxx_compiler_flag(-Wconversion          LIBCXXABI_HAS_WCONVERSION_FLAG)
+check_cxx_compiler_flag(-Wnewline-eof         LIBCXXABI_HAS_WNEWLINE_EOF_FLAG)
 check_cxx_compiler_flag(-pedantic             LIBCXXABI_HAS_PEDANTIC_FLAG)
 check_cxx_compiler_flag(-Werror               LIBCXXABI_HAS_WERROR_FLAG)
 check_cxx_compiler_flag(-Wno-error            LIBCXXABI_HAS_WNO_ERROR_FLAG)
-check_cxx_compiler_flag(-fno-rtti             LIBCXXABI_HAS_FNO_RTTI_FLAG)
 check_cxx_compiler_flag(/WX                   LIBCXXABI_HAS_WX_FLAG)
 check_cxx_compiler_flag(/WX-                  LIBCXXABI_HAS_NO_WX_FLAG)
 check_cxx_compiler_flag(/EHsc                 LIBCXXABI_HAS_EHSC_FLAG)





More information about the cfe-commits mailing list