make usage of clang-tidy configurable

This commit is contained in:
Sebastian Krzyszkowiak 2017-09-10 22:53:41 +02:00
parent 8cfde8c55f
commit ca33fd7752
2 changed files with 11 additions and 10 deletions

View file

@ -16,16 +16,15 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
endif(APPLE) endif(APPLE)
find_program( set(USE_CLANG_TIDY "yes" CACHE STRING "Analyze the code with clang-tidy" )
CLANG_TIDY_EXE if(USE_CLANG_TIDY)
NAMES "clang-tidy" find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable")
DOC "Path to clang-tidy executable"
)
if(NOT CLANG_TIDY_EXE) if(NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy not found.") message(STATUS "clang-tidy not found, analysis disabled")
else() else()
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-google-readability-todo,-performance-type-promotion-in-math-fn,-misc-unused-parameters,-cert-msc30-c,-cert-msc50-cpp") set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-google-readability-todo,-performance-type-promotion-in-math-fn,-misc-unused-parameters,-cert-msc30-c,-cert-msc50-cpp")
endif() endif()
endif()
if(APPLE) if(APPLE)
if(CMAKE_INSTALL_PREFIX MATCHES "/usr/local") if(CMAKE_INSTALL_PREFIX MATCHES "/usr/local")

View file

@ -188,7 +188,9 @@ SYMBOL_INTERNAL void GamestateProgress(struct Game* game) {
} }
#ifdef LIBSUPERDERPY_SINGLE_THREAD #ifdef LIBSUPERDERPY_SINGLE_THREAD
DrawGamestates(game); DrawGamestates(game);
if (tmp->showLoading) (*game->_priv.loading.gamestate->api->Gamestate_Draw)(game, game->_priv.loading.gamestate->data); if (tmp->showLoading) {
(*game->_priv.loading.gamestate->api->Gamestate_Draw)(game, game->_priv.loading.gamestate->data);
}
DrawConsole(game); DrawConsole(game);
al_flip_display(); al_flip_display();
#endif #endif