Skip to content

Commit 78c8b2b

Browse files
committed
Show diff on cmake lint failure
1 parent 3584545 commit 78c8b2b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/cmake-lint.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ jobs:
2323
- name: Run cmake-format
2424
run: |
2525
files=$(git ls-files '**/CMakeLists.txt' 'cmake/*.cmake')
26-
cmake-format --check $files
26+
if ! cmake-format --check $files; then
27+
echo "Formatting errors detected. Showing diff..."
28+
for f in $files; do
29+
cmake-format "$f" | diff -u "$f" -
30+
done
31+
exit 1
32+
fi

cmake/configure.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ endif()
3636

3737
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
3838
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
39-
set(CMAKE_SKIP_BUILD_RPATH OFF)
39+
set(
40+
CMAKE_SKIP_BUILD_RPATH OFF)
4041

4142
if(UNIX)
4243
set(COMMON_COMPILER_FLAGS

0 commit comments

Comments
 (0)