diff --git a/CMakeLists.txt b/CMakeLists.txt index 550de843..6eecbb41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,3 +262,24 @@ endif() if (BUILD_CLIENT) add_subdirectory(client) endif() + + +FIND_PROGRAM(CLANG_FORMAT "clang-format") +IF(CLANG_FORMAT) + FILE(GLOB_RECURSE + CHECK_CXX_SOURCE_FILES + common/*.[ch]pp + client/*.[ch]pp + server/*.[ch]pp + ) + + ADD_CUSTOM_TARGET( + reformat + COMMAND + ${CLANG_FORMAT} + -i + -style=file + ${CHECK_CXX_SOURCE_FILES} + COMMENT "Auto formatting of all source files" + ) +ENDIF() diff --git a/client/controller.cpp b/client/controller.cpp index 95e0c756..3510f07f 100644 --- a/client/controller.cpp +++ b/client/controller.cpp @@ -45,7 +45,7 @@ #include "player/coreaudio_player.hpp" #endif #ifdef HAS_WASAPI -#include "player/wasapi_player.h" +#include "player/wasapi_player.hpp" #endif #include "player/file_player.hpp" diff --git a/client/player/wasapi_player.cpp b/client/player/wasapi_player.cpp index ffd6a1e9..252c7c42 100644 --- a/client/player/wasapi_player.cpp +++ b/client/player/wasapi_player.cpp @@ -1,4 +1,4 @@ -#include "wasapi_player.h" +#include "wasapi_player.hpp" #include #include //#include diff --git a/client/player/wasapi_player.h b/client/player/wasapi_player.hpp similarity index 98% rename from client/player/wasapi_player.h rename to client/player/wasapi_player.hpp index 05842695..04675f3d 100644 --- a/client/player/wasapi_player.h +++ b/client/player/wasapi_player.hpp @@ -16,8 +16,9 @@ along with this program. If not, see . ***/ -#ifndef WASAPI_PLAYER_H -#define WASAPI_PLAYER_H +#ifndef WASAPI_PLAYER_HPP +#define WASAPI_PLAYER_HPP + #include "player.hpp" #include #include diff --git a/client/snapclient.cpp b/client/snapclient.cpp index 2697015c..994a2777 100644 --- a/client/snapclient.cpp +++ b/client/snapclient.cpp @@ -30,7 +30,7 @@ #include "player/alsa_player.hpp" #endif #ifdef HAS_WASAPI -#include "player/wasapi_player.h" +#include "player/wasapi_player.hpp" #endif #ifdef HAS_DAEMON #include "common/daemon.hpp"