Refactor app modules and add clang-format
This commit is contained in:
@@ -6,6 +6,8 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
find_program(CLANG_FORMAT_BIN clang-format)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
option(TELEGRAM_TUI_USE_SYSTEM_TDLIB "Use an installed TDLib package instead of fetching it." OFF)
|
||||
@@ -36,8 +38,13 @@ add_executable(
|
||||
shinoa
|
||||
src/app_attachments.cpp
|
||||
src/app_chats.cpp
|
||||
src/app_commands.cpp
|
||||
src/app.cpp
|
||||
src/app_auth.cpp
|
||||
src/app_help.cpp
|
||||
src/app_input.cpp
|
||||
src/app_messages.cpp
|
||||
src/app_shell.cpp
|
||||
src/app_state.cpp
|
||||
src/main.cpp
|
||||
src/models.cpp
|
||||
@@ -45,6 +52,19 @@ add_executable(
|
||||
src/util.cpp
|
||||
)
|
||||
|
||||
if(CLANG_FORMAT_BIN)
|
||||
file(GLOB_RECURSE SHINOA_FORMAT_SOURCES CONFIGURE_DEPENDS
|
||||
src/*.cpp
|
||||
src/*.h
|
||||
)
|
||||
add_custom_target(
|
||||
format
|
||||
COMMAND ${CLANG_FORMAT_BIN} -i ${SHINOA_FORMAT_SOURCES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Formatting C++ sources with clang-format"
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(shinoa PRIVATE ${CURSES_INCLUDE_DIRS})
|
||||
target_link_libraries(shinoa PRIVATE ${CURSES_LIBRARIES})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user