File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
66 set (CLANG_FORMAT_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR} /FormatValidation/clang-format_10.0.0.exe" CACHE INTERNAL "clang-format executable path" )
77elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" )
88 set (CLANG_FORMAT_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR} /FormatValidation/clang-format_linux_10.0.0" CACHE INTERNAL "clang-format executable path" )
9+ execute_process (
10+ COMMAND "${CLANG_FORMAT_EXECUTABLE} " --version
11+ RESULT_VARIABLE CLANG_FORMAT_EXIT_CODE
12+ )
13+ if (NOT CLANG_FORMAT_EXIT_CODE EQUAL 0)
14+ message (WARNING "${CLANG_FORMAT_EXECUTABLE} failed to run. Format validation will be disabled." )
15+ unset (CLANG_FORMAT_EXECUTABLE CACHE )
16+ endif ()
917elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" )
1018 set (CLANG_FORMAT_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR} /FormatValidation/clang-format_mac_10.0.0" CACHE INTERNAL "clang-format executable path" )
1119endif ()
You can’t perform that action at this time.
0 commit comments