cmake: Improve command detection (#14166)

This commit is contained in:
Ashcon Partovi
2024-10-01 15:37:57 -07:00
committed by GitHub
parent 944f342072
commit 98e09efd02
13 changed files with 66 additions and 227 deletions

View File

@@ -7,6 +7,8 @@ find_command(
LLVM_VERSION
COMMAND
clang-format
VERSION
${LLVM_VERSION}
REQUIRED
OFF
)

View File

@@ -7,6 +7,8 @@ find_command(
LLVM_VERSION
COMMAND
clang-tidy
VERSION
${LLVM_VERSION}
REQUIRED
OFF
)

View File

@@ -1,7 +1,7 @@
# IWYU = "Include What You Use"
# https://include-what-you-use.org/
setx(IWYU_SOURCE_PATH ${CACHE_PATH}/iwyu-${LLVM_VERSION_MAJOR})
setx(IWYU_SOURCE_PATH ${CACHE_PATH}/iwyu-${LLVM_VERSION})
setx(IWYU_BUILD_PATH ${IWYU_SOURCE_PATH}/build)
setx(IWYU_PROGRAM ${IWYU_BUILD_PATH}/bin/include-what-you-use)
@@ -11,7 +11,7 @@ register_repository(
REPOSITORY
include-what-you-use/include-what-you-use
BRANCH
clang_${LLVM_VERSION_MAJOR}
clang_${LLVM_VERSION}
PATH
${IWYU_SOURCE_PATH}
)

View File

@@ -95,7 +95,7 @@ register_command(
if(GIT_CHANGED_SOURCES)
set(PRETTIER_CHANGED_SOURCES)
foreach(source ${PRETTIER_SOURCES})
list(FIND PRETTIER_CHANGED_SOURCES ${source} index)
list(FIND GIT_CHANGED_SOURCES ${source} index)
if(NOT ${index} EQUAL -1)
list(APPEND PRETTIER_CHANGED_SOURCES ${source})
endif()