mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmSourceFile: Change parameter to string_view
This commit is contained in:
committed by
Brad King
parent
c3c3b10d60
commit
f53296147f
@@ -282,14 +282,14 @@ void cmSourceFile::CheckExtension()
|
||||
}
|
||||
}
|
||||
|
||||
void cmSourceFile::CheckLanguage(std::string const& ext)
|
||||
void cmSourceFile::CheckLanguage(cm::string_view ext)
|
||||
{
|
||||
// Try to identify the source file language from the extension.
|
||||
cmMakefile const* mf = this->Location.GetMakefile();
|
||||
cmGlobalGenerator* gg = mf->GetGlobalGenerator();
|
||||
std::string l = gg->GetLanguageFromExtension(ext);
|
||||
if (!l.empty()) {
|
||||
this->Language = l;
|
||||
this->Language = std::move(l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <cm/string_view>
|
||||
|
||||
#include "cmCustomCommand.h"
|
||||
#include "cmListFileCache.h"
|
||||
#include "cmPropertyMap.h"
|
||||
@@ -200,7 +202,7 @@ private:
|
||||
|
||||
bool FindFullPath(std::string* error, std::string* cmp0115Warning);
|
||||
void CheckExtension();
|
||||
void CheckLanguage(std::string const& ext);
|
||||
void CheckLanguage(cm::string_view ext);
|
||||
|
||||
static std::string const propLANGUAGE;
|
||||
static std::string const propLOCATION;
|
||||
|
||||
Reference in New Issue
Block a user