diff --git a/clang/lib/Format/CMakeLists.txt b/clang/lib/Format/CMakeLists.txt index b787b11ac7b74..f7bf53eb22c5c 100644 --- a/clang/lib/Format/CMakeLists.txt +++ b/clang/lib/Format/CMakeLists.txt @@ -53,3 +53,13 @@ foreach (file IN LISTS files) endforeach () add_custom_target(clang-format-check-format DEPENDS ${check_format_depends}) + +set(style_options_depends ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst) +add_custom_command(OUTPUT ${style_options_depends} + COMMAND ${Python3_EXECUTABLE} dump_format_style.py + WORKING_DIRECTORY ${CLANG_SOURCE_DIR}/docs/tools + DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h + ${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h + ) +add_custom_target(clang-format-style-options DEPENDS ${style_options_depends}) +add_dependencies(clangFormat clang-format-style-options)