Skip to content

Commit c404d9c

Browse files
sergeyklayStableCoder
authored andcommitted
Setting ininial value for FORMAT_FILES variable
This patch aims to fix CMake warnings like these: ``` CMake Warning (dev) at external/cmake-scripts/formatting.cmake:113 (set): uninitialized variable 'FORMAT_FILES' Call Stack (most recent call first): CMakeLists.txt:100 (cmake_format) This warning is for project developers. Use -Wno-dev to suppress it. ```
1 parent 48161cc commit c404d9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

formatting.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ endif()
3939
# ~~~
4040
function(clang_format TARGET_NAME)
4141
if(CLANG_FORMAT_EXE)
42-
# Check through the ARGN's, determine existant files
42+
set(FORMAT_FILES)
43+
# Check through the ARGN's, determine existent files
4344
foreach(item IN LISTS ARGN)
4445
if(TARGET ${item})
4546
# If the item is a target, then we'll attempt to grab the associated
@@ -109,6 +110,7 @@ endif()
109110
# ~~~
110111
function(cmake_format TARGET_NAME)
111112
if(CMAKE_FORMAT_EXE)
113+
set(FORMAT_FILES)
112114
# Determine files that exist
113115
foreach(iter IN LISTS ARGN)
114116
if(EXISTS ${iter})

0 commit comments

Comments
 (0)