gmx_manage_lmfit()
target_link_libraries(libgromacs PRIVATE lmfit)
-set(IGNORED_CLANG_ALL_WARNINGS
- "-Wno-c++98-compat -Wno-c++98-compat-pedantic" #No intention of C++98 compability
- "-Wno-source-uses-openmp" #Don't warn for no-omp build
- "-Wno-c++17-extensions" #Allowed in attributes (compilers are required to ignore unknown attributes)
- "-Wno-documentation-unknown-command" #Custom commands are used
- "-Wno-covered-switch-default" #GCC gives maybe-uninitialized without default label and checks for illegal enum values.
- "-Wno-switch-enum" # default statement for enum is OK
-
- #Following ones are undecided/TODO
- "-Wno-disabled-macro-expansion"
- "-Wno-reserved-id-macro"
- "-Wno-global-constructors"
- "-Wno-exit-time-destructors"
- "-Wno-unused-macros"
- "-Wno-weak-vtables"
- "-Wno-conditional-uninitialized"
- "-Wno-format-nonliteral"
- "-Wno-shadow"
- "-Wno-cast-qual"
- "-Wno-documentation"
- "-Wno-used-but-marked-unused"
- "-Wno-padded"
- "-Wno-float-equal"
- "-Wno-conversion"
- "-Wno-double-promotion")
-string(REPLACE " " ";" IGNORED_CLANG_ALL_WARNINGS "${IGNORED_CLANG_ALL_WARNINGS}")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^6\.0")
target_compile_options(libgromacs PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Weverything ${IGNORED_CLANG_ALL_WARNINGS}>)
endif()
>
)
endif()
+
if (GMX_CLANG_TIDY)
- set(CLANG_TIDY "clang-tidy" CACHE STRING "Name of clang-tidy executable")
- find_program(CLANG_TIDY_EXE NAMES "${CLANG_TIDY}"
- DOC "Path to clang-tidy executable")
- if(NOT CLANG_TIDY_EXE)
- message(FATAL_ERROR "clang-tidy not found.")
- endif()
- if(CMAKE_VERSION VERSION_LESS "3.6")
- message(FATAL_ERROR "clang-tidy support requires cmake 3.6.")
- endif()
- set(CLANG_TIDY_CHECKS
- "-clang-analyzer-security.insecureAPI.strcpy"
- "bugprone-*" "misc-*" "readability-*" "performance-*" "mpi-*"
- "-misc-incorrect-roundings" #TODO: #2562
- "-readability-else-after-return"
- "-readability-inconsistent-declaration-parameter-name"
- "-readability-implicit-bool-conversion" #TODO: Remove gmx_bool
- "modernize-use-nullptr" "modernize-use-emplace"
- "modernize-make-unique" "modernize-make-shared"
- "google-readability-casting"
- "cppcoreguidelines-*" "-cppcoreguidelines-pro-*"
- "-cppcoreguidelines-owning-memory"
- "-cppcoreguidelines-no-malloc"
- "-cppcoreguidelines-special-member-functions" #in conflict with Wunused-member-function
- )
- string(REPLACE ";" "," CLANG_TIDY_CHECKS "${CLANG_TIDY_CHECKS}")
set_target_properties(libgromacs PROPERTIES CXX_CLANG_TIDY
- "${CLANG_TIDY_EXE};--checks=${CLANG_TIDY_CHECKS};-warnings-as-errors=*;-header-filter=.*")
+ "${CLANG_TIDY_EXE};-warnings-as-errors=*;-header-filter=.*")
endif()
gmx_write_installed_header_list()