mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
build: add clang-format target
Through the power of CMake itself, we can format our files Signed-off-by: Seth Flynn <getchoo@tuta.io>
This commit is contained in:
parent
1c4d378fc4
commit
686ad72e03
1 changed files with 12 additions and 0 deletions
|
|
@ -1625,3 +1625,15 @@ if(WIN32 OR (UNIX AND APPLE))
|
||||||
COMPONENT bundle
|
COMPONENT bundle
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_program(CLANG_FORMAT clang-format OPTIONAL)
|
||||||
|
if(CLANG_FORMAT)
|
||||||
|
message(STATUS "Creating clang-format target")
|
||||||
|
add_custom_target(
|
||||||
|
clang-format
|
||||||
|
COMMAND ${CLANG_FORMAT} -i --style=file:${CMAKE_SOURCE_DIR}/.clang-format ${LOGIC_SOURCES} ${LAUNCHER_SOURCES} ${PRISMUPDATER_SOURCES} ${LINKEXE_SOURCES} ${PRECOMPILED_HEADERS}
|
||||||
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
message(WARNING "Unable to find `clang-format`. Not creating custom target")
|
||||||
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue