mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
cmake: Avoid calling GetCMakeListFile with empty directory
This commit is contained in:
@@ -4517,8 +4517,8 @@ void cmake::SetCMakeListName(std::string const& name)
|
||||
|
||||
std::string cmake::GetCMakeListFile(std::string const& dir) const
|
||||
{
|
||||
cm::string_view const slash =
|
||||
dir.empty() || dir.back() != '/' ? "/"_s : ""_s;
|
||||
assert(!dir.empty());
|
||||
cm::string_view const slash = dir.back() != '/' ? "/"_s : ""_s;
|
||||
std::string listFile;
|
||||
if (!this->CMakeListName.empty()) {
|
||||
listFile = cmStrCat(dir, slash, this->CMakeListName);
|
||||
|
||||
Reference in New Issue
Block a user