This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -189,12 +189,15 @@ add_custom_target(copyright-format
189189 BSD-3-Clause -d )
190190
191191
192+ find_program (CLANG_FORMAT NAMES clang-format-9 clang-format-9.0 clang-format )
193+ set (CLANG_FORMAT_REQUIRED "9.0" )
194+ if (CLANG_FORMAT)
195+ get_program_version_major_minor (${CLANG_FORMAT} CLANG_FORMAT_VERSION )
196+ message (STATUS "Found clang-format: ${CLANG_FORMAT} (version: ${CLANG_FORMAT_VERSION} )" )
197+ endif ()
198+
192199if (CHECK_CPP_STYLE)
193- find_program (CLANG_FORMAT NAMES clang-format clang-format-9 clang-format-9.0 )
194- set (CLANG_FORMAT_REQUIRED "9.0" )
195200 if (CLANG_FORMAT)
196- get_program_version_major_minor (${CLANG_FORMAT} CLANG_FORMAT_VERSION )
197- message (STATUS "Found clang-format: ${CLANG_FORMAT} (version: ${CLANG_FORMAT_VERSION} )" )
198201 if (NOT (CLANG_FORMAT_VERSION VERSION_EQUAL CLANG_FORMAT_REQUIRED))
199202 message (FATAL_ERROR "required clang-format version is ${CLANG_FORMAT_REQUIRED} " )
200203 endif ()
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ endmacro()
9999# instead.
100100# ${name} must be unique.
101101function (add_cppstyle name )
102- if (NOT CLANG_FORMAT)
102+ if (NOT CLANG_FORMAT OR NOT (CLANG_FORMAT_VERSION VERSION_EQUAL CLANG_FORMAT_REQUIRED) )
103103 return ()
104104 endif ()
105105
You can’t perform that action at this time.
0 commit comments