mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00: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
|
|
@ -1625,3 +1625,15 @@ if(WIN32 OR (UNIX AND APPLE))
|
|||
COMPONENT bundle
|
||||
)
|
||||
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…
Reference in a new issue