Add reformat target to CMakeLists.txt

This commit is contained in:
badaix 2020-08-04 18:46:58 +02:00
parent cc6186c4ba
commit 8186c44118
5 changed files with 27 additions and 5 deletions

View file

@ -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()

View file

@ -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"

View file

@ -1,4 +1,4 @@
#include "wasapi_player.h"
#include "wasapi_player.hpp"
#include <initguid.h>
#include <mmdeviceapi.h>
//#include <functiondiscoverykeys_devpkey.h>

View file

@ -16,8 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef WASAPI_PLAYER_H
#define WASAPI_PLAYER_H
#ifndef WASAPI_PLAYER_HPP
#define WASAPI_PLAYER_HPP
#include "player.hpp"
#include <audiopolicy.h>
#include <endpointvolume.h>

View file

@ -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"