From eada65a37e18bea23e3cbf584f47f72859cc69f9 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Fri, 21 Sep 2018 23:26:56 -0700 Subject: [PATCH] cmake: Enable -Wall. --- CMakeLists.txt | 5 +++++ src/parser/CMakeLists.txt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b733b65d1..ad6adf2e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,11 +148,16 @@ include(Config${CMAKE_BUILD_TYPE}) # Compiler flags add_check_c_cxx_flag("-O${OPTIMIZATION_LEVEL}") +add_check_c_cxx_flag("-Wall") add_check_c_flag("-fexceptions") add_check_c_cxx_flag("-Wno-deprecated") add_check_cxx_flag("-Wsuggest-override") add_check_cxx_flag("-Wnon-virtual-dtor") +# Temporarily disable -Wclass-memaccess to suppress 'no trivial copy-assignment' +# cdlist.h warnings. Remove when fixed. +add_check_cxx_flag("-Wno-class-memaccess") + #-----------------------------------------------------------------------------# # Option defaults (three-valued options (cvc4_option(...))) # diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt index 6cde56c62..d7491f8ca 100644 --- a/src/parser/CMakeLists.txt +++ b/src/parser/CMakeLists.txt @@ -82,6 +82,10 @@ foreach(lang Cvc Smt1 Smt2 Tptp) set_source_files_properties(${gen_src_files} PROPERTIES LANGUAGE CXX) set_source_files_properties(${gen_src_files} PROPERTIES GENERATED TRUE) + # We don't want to enable -Wall for code generated by ANTLR. + set_source_files_properties( + ${gen_src_files} PROPERTIES COMPILE_FLAGS -Wno-all) + # Add generated source files to the parser source files list(APPEND libcvc4parser_src_files ${gen_src_files}) endforeach() -- 2.30.2