Skip to content

Commit

Permalink
Remove CMake string REPEAT (#9771)
Browse files Browse the repository at this point in the history
According to https://cmake.org/cmake/help/latest/command/string.html#repeat this was added in 3.15, we can revert this if we ever use a minimum cmake newer than that. Until then we should just remove the alternate path to reduce complexity.

Co-authored-by: driazati <driazati@users.noreply.github.com>
  • Loading branch information
driazati and driazati committed Dec 18, 2021
1 parent 89b1676 commit bad5861
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmake/utils/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ function(pad_string output str padchar length)
math(EXPR _strlen "${length} - ${_strlen}")

if(_strlen GREATER 0)
if(${CMAKE_VERSION} VERSION_LESS "3.14")
unset(_pad)
foreach(_i RANGE 1 ${_strlen}) # inclusive
string(APPEND _pad ${padchar})
string(APPEND _pad ${padchar})
endforeach()
else()
string(REPEAT ${padchar} ${_strlen} _pad)
endif()
string(APPEND str ${_pad})
string(APPEND str ${_pad})
endif()

set(${output} "${str}" PARENT_SCOPE)
Expand Down

0 comments on commit bad5861

Please sign in to comment.